Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chain simulator force change of epoch #6173

Merged
merged 2 commits into from
May 20, 2024

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented May 16, 2024

Reasoning behind the pull request

  • Added a new method that will trigger a change of epoch

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@miiu96 miiu96 self-assigned this May 16, 2024
iulianpascalau
iulianpascalau previously approved these changes May 16, 2024

epoch := s.nodes[core.MetachainShardId].GetProcessComponents().EpochStartTrigger().Epoch()

return s.GenerateBlocksUntilEpochIsReached(int32(epoch + 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

require.Nil(t, err)

err = chainSimulator.ForceChangeOfEpoch()
require.Nil(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add an assert here that the epoch is 5 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

iulianpascalau
iulianpascalau previously approved these changes May 16, 2024
sstanculeanu
sstanculeanu previously approved these changes May 20, 2024
@@ -278,6 +278,22 @@ func (s *simulator) incrementRoundOnAllValidators() {
}
}

// ForceChangeOfEpoch will force the change of current epoch
// This method will call the epoch change trigger and generate block till a new epoch is reached
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This method will call the epoch change trigger and generate block till a new epoch is reached
// This method will call the epoch change trigger and generate blocks till a new epoch is reached

@miiu96 miiu96 changed the base branch from rc/v1.7.next1 to feat/chain-simulator-improvments May 20, 2024 13:12
@miiu96 miiu96 dismissed stale reviews from sstanculeanu and iulianpascalau May 20, 2024 13:12

The base branch was changed.

@miiu96 miiu96 merged commit e25b97d into feat/chain-simulator-improvments May 20, 2024
7 checks passed
@miiu96 miiu96 deleted the force-change-of-epoch branch May 20, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants