You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(sc): split contract CommitBatch and UpdateState calls
- 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.
- 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.
0 commit comments