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

Functional StatefulBlock #1773

Open
aaronbuchwald opened this issue Nov 13, 2024 · 0 comments
Open

Functional StatefulBlock #1773

aaronbuchwald opened this issue Nov 13, 2024 · 0 comments

Comments

@aaronbuchwald
Copy link
Collaborator

StatefulBlock and Avalanche consensus engine guarantee that a block is only verified when its parent (and all ancestors) have been verified and accepted when its parent (and all ancestors have been accepted.

Switch StatefulBlock to support a functional flow that the chain/DSMR package can implement of: ExecutionBlock -> ExecutedBlock -> AcceptedBlock.

The chain then takes responsibility for committing its own state and the VM is responsible for passing in the required input types and maintaining a chain index that guarantees the last accepted block stored on disk is ahead of the last accepted block committed by the chain. This ensures that when writing to two different databases, if the chain is behind ie. merkle root is at block N-2, the VM has the blocks required to re-execute and re-compute the last accepted state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant