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

ForkedChain implementation #2405

Merged
merged 18 commits into from
Jun 26, 2024
Merged

ForkedChain implementation #2405

merged 18 commits into from
Jun 26, 2024

Conversation

jangko
Copy link
Contributor

@jangko jangko commented Jun 21, 2024

  • revamp test_blockchain_json using ForkedChain
  • re-enable previously failing test cases.

No optimization

The new test_blockchain_json total run time is not slower than the old one although we employ chain replay. Probably because we also skip descendants of invalid chains altogether instead of try to validate/execute it.

Also the_blockchain_json not relying on total difficulty/chain score anymore even when testing pre PoS chains.

note: uncles, withdrawals, transactions, and receipts are not written to database.

fix #2260

- revamp test_blockchain_json using ForkedChain
- re-enable previously failing test cases.
@jangko jangko requested a review from arnetheduck June 21, 2024 10:10
c.replaySegment(finalizedHash)
c.writeBaggage(finalizedHash)
c.stagingTx.commit()
# Update base forward to finalized
Copy link
Member

@arnetheduck arnetheduck Jun 25, 2024

Choose a reason for hiding this comment

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

here, base should move to min(finalized.blockNumber, nax(head.blockNumber, baseDistance) - baseDistance) where baseDistance is the 128 constant - later we'll make that configurable as well - it's important to have base at least that much behind so we can answer state queries about history that deep.

Copy link
Member

Choose a reason for hiding this comment

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

this probably means moving the computation of the base block up a bit and separating finalizedHash and baseHash - they are two separate concepts - finalizedHash will typically be 64-95 blocks behind head depending on how the voting goes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arnetheduck
Copy link
Member

Alright! I think this is enough to cover the MVP needs for this part, we'll obviously need to revisit a lot of it but we can start wiring it up to the execution API and the rest of nimbus 🥳

@jangko jangko merged commit cd21c4f into master Jun 26, 2024
8 checks passed
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.

Mising operations of Aristo: handle sidechain in memory
3 participants