[EVM] DRAFT - Replace EVM.BridgeRouter interface with implementation #5821
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.
Related: onflow/flow-evm-bridge#60
While redeploying bridge contracts to Previewnet, I realized that the Accessor-Router pattern originally introduced is subverted by the Router being defined in a bridge contract. The idea originally was to define a neutral party router which would store a bridge-defined accessor through which the EVM contract would pass bridge calls to from COAs. However, currently, the BridgeRouter implementation is defined in a bridge contract which, in the event of a redeployment, must necessarily be replaced thus defeating the original purpose of the design.
This draft PR seeks to address this issue by replacing the interface with a resource definition within the EVM contract. I'm leaving this as a draft to serve as a point of discussion for a couple of points I could use clarity on:
a. If not, we could leave the EVM contract as-is and simply deploy a simple BridgeRouter defining contract to the EVM host account
a. If we proceed with the alternative in 1.a, this wouldn't be a problem as the resource could be initialized on the new contract's deployment
b. If we move forward with the EVM contract as proposed in this PR, is there a way we could execute an initialization block to remove the need for the public
initBridgeRouter
method and just include setup in the contract'sinit
block?You can see changes in context in onflow/flow-evm-bridge#61