refactor(sc): split contract CommitBatch and UpdateState calls#640
Merged
Conversation
875feae to
4e9068b
Compare
oclaw
reviewed
Mar 25, 2025
akokoshn
reviewed
Mar 26, 2025
zadykian
reviewed
Mar 26, 2025
4e9068b to
377fd5f
Compare
zadykian
approved these changes
Apr 1, 2025
- Refactored CommitBatch and UpdateState methods: - CommitBatch now called in the aggregator service just before creating proof tasks. Transaction creation is skipped if a batch with the same ID has already been submitted. - UpdateState is still called in the proposer service after it mentions there is a new state to be proposed. - UpdateState now retrieves the CommitBatch transaction for the specified batch ID from L1 and extracts blob data. - Instead of returning etherium transaction methods wait for transaction for being included into block. - Transactions field of BlockBatch is replaced with DataProofs to be used during UpdateState call. - Improved error handling and configuration: - Proposer now handles `ErrBatchAlreadyFinalized` by refreshing the last proved state root from L1 if local tasks state is out of sync. - Introduced a dummy structure mode for the EthClient when the DisableL1 config option is set, which logs calls without returning errors. - Optimized contract and client interactions: - Shared the contract wrapper between Aggregator and Proposer to streamline interactions. - Encapsulated retry logic within the EthClient, which now acts as a wrapper around go-ethereum/ethclient. - Extended testing and utilities: - Migrated contract mocker to the testaide package for broader reuse in tests. - Added new tests for both the proposer and the wrapper to ensure robustness.
377fd5f to
00c0fb1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactored CommitBatch and UpdateState methods:
Improved error handling and configuration:
ErrBatchAlreadyFinalizedby refreshing the last proved state root from L1 if local tasks state is out of sync.Optimized contract and client interactions:
Extended testing and utilities: