fuel-core
fuel-core copied to clipboard
Support re-index of eth events if contract address changes
The relayer needs to be able to support ethereum beidge contract migrations.
When a newer bridge contract is deployed, we'll need the ability to reset the finalized height of the relayer to when the new contract is deployed and download missing logs. This will either require all eth log downloading and persistence to be idempotent (and resync potentially duplicate logs) or track our finalized_da_height on a per-contract address basis, where we report our finalized height to other parts of the system as the min of all contract finalization heights.
related: https://github.com/FuelLabs/fuel-core/issues/781
The contract migration is related to the upgradability flow. We need to define the workflow of the upgrade first. The contracts should be part of the ChainConfig
. Otherwise, nodes in the network could have different sets of synced data.
If we can change the contract/list of contracts that we need to listen to on the fly, we need to apply new rules for all nodes in the network at the same block. Also, maybe we need to abandon some old events because of the bugs in the old contracts.
With the fork strategy, it should not be a problem for us because it is a common synchronization from the genesis block.
But with the upgradability of the config on the fly, it adds some troubles=)
Our system is not designed for cases when we update the DA contract. If the contract changes, it basically requires the fork of the network, and all old messages should still be available.
More details about messages migration here.
I'm closing this issue since we don't need to specify the contract address in the consensus parameters. Each rollup already knows his contract on L1, and the generation of invalid blocks(blocks that are using events from another contract) will be punished through fraud proofs.