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

Fixed the initialization of the chain simulator when working with 0-value activation epochs #6126

Merged
merged 6 commits into from Apr 24, 2024

Conversation

iulianpascalau
Copy link
Contributor

@iulianpascalau iulianpascalau commented Apr 19, 2024

Reasoning behind the pull request

  • Chain simulator can not start with 0-value activation epochs as the epochStartSCProcessor needs to properly initialize some system smart contracts

Proposed changes

  • fixed the initialization of the chain simulator when working with 0 value activation epochs by manually calling the EpochSystemSCProcessor.ProcessSystemSmartContract method on the metachain node
  • added RemoveAccounts function on the chain simulator

Testing procedure

  • standard system test, the main code base, although changed, is not impacted
  • import-db test for the changed line in epochStart/metachain/legacySystemSCs.go

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 previously approved these changes Apr 23, 2024
require.Equal(t, accountState.Owner, account.OwnerAddress)
require.Equal(t, accountState.RootHash, base64.StdEncoding.EncodeToString(account.RootHash))

}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty line before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

Normal allin test: v1.6.15-dev-config-eb2e06c06d -> fixed-chain-simulator-zero-a32cde0cd3

--- Specific errors ---

block hash does not match 139
wrong nonce in block 114
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0

/------/

--- Statistics ---

Nr. of all ERRORS: 0
Nr. of all WARNS: 234
Nr. of new ERRORS: 0
Nr. of new WARNS: 6
Nr. of PANICS: 0

/------/

--- ERRORS ---

/------/

--- WARNINGS ---

/------/

@miiu96 miiu96 merged commit e5c9201 into rc/v1.7.0 Apr 24, 2024
8 checks passed
@miiu96 miiu96 deleted the fixed-chain-simulator-zero-epoch-init branch April 24, 2024 11:49
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

5 participants