Spike to compute EVM remote accounts deterministically #12204
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.
refs:
Description
This pull request introduces a major refactor to the EVM account provisioning flow for the portfolio contract, shifting from asynchronous remote address resolution via Axelar upcalls to deterministic local precomputation of the remote account address using the CREATE2 formula. This change reduces latency, simplifies orchestration, and improves reliability by removing callback dependencies. To support this, new configuration fields and helper utilities are added, and the contract context and flow logic are updated accordingly.
The
provideEVMAccountflow deterministically computes the remote EVM account address locally using the CREATE2 formula and resolves immediately, removing the dependency on Axelar upcall for address retrieval.The
EVMContractAddressestype and related config files are extended to includegatewayandgasServiceaddresses, which are required for address computation and deployment orchestration.The contract context (
PortfolioInstanceContext) and flow wiring are updated to include the new addresses, a Wallet artifact reference, and chain info for EVM chains.A new module
wallet-artifact.tsis introduced to hold the Wallet contract's creation bytecode, which will be used for local address prediction. This likely need toA utility module
create2.tsis added, providing helpers for salt derivation, init code hash computation, and deterministic address prediction using the same formulas as Solidity's CREATE2.Security Considerations
Eliminates the need for EVM chains to send the address back
Scaling Considerations
N/A
Documentation Considerations
N/A
Testing Considerations
gatewayandgasServicefields, ensuring coverage of the new deterministic address computation logic.Upgrade Considerations
Already-existing accounts shoudl continue to work.