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

Implement DSMR Chain Functionality #1774

Open
aaronbuchwald opened this issue Nov 13, 2024 · 1 comment
Open

Implement DSMR Chain Functionality #1774

aaronbuchwald opened this issue Nov 13, 2024 · 1 comment
Labels

Comments

@aaronbuchwald
Copy link
Collaborator

The chain type ties together the required functionality of building/parsing/executing/accepting blocks (as well as PreExecute for the mempool), which is used by the VM.

Implement the equivalent functionality for the DSMR package (excluding pre-execute since this will be handled at the mempool layer):

type Chain interface {
	// BuildBlock produces a new chunk based block skipping any duplicates that have either already been accepted
	// or are included in the processing ancestry of parent.
	BuildBlock(ctx context.Context, parent ExecutedBlock) (ExecutionBlock, error)
	// Execute executes the given block with the provided parent (guaranteed to have been executed successfully).
	// Execute verifies each chunk certificate as valid within the current epoch and 
	Execute(ctx context.Context, parentBlock ExecutedBlock, block ExecutionBlock) (ExecutedBlock, error)
	// ParseBlock returns an execution block that can be executed against its parent.
	ParseBlock(ctx context.Context, bytes []byte) (ExecutionBlock, error)
	// AcceptBlock accepts the given executed block, re-assembles the inner block, and executes the inner block.
	AcceptBlock(ctx context.Context, parent AcceptedBlock, block ExecutedBlock) (AcceptedBlock, error)
}
@lattaai9
Copy link

Hello, I tried to solve the issue.

This is what I did:

Implement the equivalent functionality for the DSMR package as described in the criteria. This includes BuildBlock, Execute, ParseBlock, and AcceptBlock methods.

You can review changes in this commit: lattaai9@ef3cc44.

Caution

Disclaimer: The commit was created by Latta AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.


This issue was tried to solve for free by Latta AI - https://latta.ai/ourmission

If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.

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

No branches or pull requests

2 participants