[chain] Binance Smart Chain (Bifrost Refactor Avalanche -> EVM)
This contains refactoring of the avalanche
client package into a common evm
package and the addition of Binance Smart Chain. This extends the tooling to support a make run-mocknet-fork-<chain>
target for EVM chains - which will fork the mainnet chain state and automatically mint 100K USDC for the corresponding chain to the admin key used by build/scripts/evm/evm-tool.py
(for aggregator swap in/out testing). In order to support this functionality the mainnet USDC tokens have been added to the testnet whitelist and the mainnet aggregator contracts have been appended to the mocknet DEX aggregator list.
Future EVM chains should be a small addition, requiring just:
- Chain defined in
common
- Token list defined in
common/tokenlist
- Bifrost chain configuration defined in
config/default.yaml
If desired in mocknet the following additions are also required:
- Daemon added to Docker Compose configuration
- Extend
build/scripts/evm/evm-tool.py
with the new chain/endpoint - Extend the chain list in
build/scripts/core-unsafe.sh
- Extend
scripts/run-mocknet-fork.sh
andtools/hardhat/init.js
ifmake run-mocknet-fork-<chain>
is desired
Future Work
This change consolidates the existing non-Ethereum EVM chains into a single chain client package, but there still remains some cleanup that should occur separately to consolidate bifrost/pkg/chainclients/ethereum
and bifrost/pkg/chainclients/shared/evm
into the new bifrost/pkg/chainclients/evm
.
Merge request reports
Activity
changed milestone to %Release-1.109.0
added chain-client cleanup labels
- Resolved by Multipartite
My familiarity with EVM chain behaviour is low, but asking whether certain sentences here could be relevant for this MR:
Nor is Ethereum Virtual Machine (EVM) compatibility a useful factor in de-risking a chain’s adoption. EVM compatibility means that (in theory) applications written for Ethereum’s virtual machine will run on any other chain making that claim. Theory doesn’t always match reality exactly, however. As a result, EVM compatibility may actually increase risk.
EVM compatibility is not perfect and the implementation on each chain is slightly different. While this can definitely make it simpler to deploy new smart contracts on a different chain, they may behave differently in a fully “compatible” environment and the claim of compatibility may increase risk that people deploy without careful consideration. We often encounter novel errors when moving smart contracts from bitcoineum testnets to the mainnet.
To what extent does this/{Future Work} intend to consolidate THORChain Go code for EVM (Ethereum/Avalanche/BSC?) chains?
|
(I speculate that many identical functions could be consolidated,
but wish to know whether such a consolidation attempt would also require consolidation of non-identical functions,
and whether differences between such functions could be necessary chain-specific differences.
|
In essence, undesirable if a large consolidation attempt went to waste because at the last step it turned out to not be doable.)Thank you for your time.
added 1 commit
- 18684b1b - [bifrost] Refactor Avalanche Client -> EVM for Binance Smart Chain
mentioned in merge request !2773 (closed)
added 5 commits
-
b38d42f7...31b20e66 - 3 commits from branch
develop
- 6b75c992 - [bifrost] Refactor Avalanche Client -> EVM for Binance Smart Chain
- 2c8c5c52 - rebase cleanup
-
b38d42f7...31b20e66 - 3 commits from branch
added 5 commits
-
d0edc9d6...781877f5 - 2 commits from branch
develop
- e8c50b24 - [bifrost] Refactor Avalanche Client -> EVM for Binance Smart Chain
- d0b4df0b - rebase cleanup
- 378af107 - smoke
Toggle commit list-
d0edc9d6...781877f5 - 2 commits from branch
removed milestone %Release-1.109.0
added auto-closed-reopen-if-needed label
removed auto-closed-reopen-if-needed label
changed milestone to %Release-1.110.0
changed milestone to %Release-1.111.0
- Resolved by Ursa (9R)
Needs manual rebase, will reapprove right after.
added 36 commits
-
378af107...3a5d01f8 - 34 commits from branch
develop
- 0b58b028 - [chain] Binance Smart Chain (Bifrost Refactor Avalanche -> EVM)
- 730f038d - add router addresses
-
378af107...3a5d01f8 - 34 commits from branch
added 5 commits
-
379099a1...7bbe6687 - 2 commits from branch
develop
- 3b0413bb - [chain] Binance Smart Chain (Bifrost Refactor Avalanche -> EVM)
- 3e730c98 - add router addresses
- 0194b639 - update tests
Toggle commit list-
379099a1...7bbe6687 - 2 commits from branch
added 8 commits
Toggle commit listmentioned in merge request !2869 (merged)
mentioned in merge request !2918 (merged)
mentioned in issue #1544 (closed)
mentioned in issue mayachain/mayanode#4 (closed)
mentioned in merge request !3279 (merged)
mentioned in issue #1777 (closed)
mentioned in merge request mayachain/mayanode!155 (closed)
mentioned in merge request mayachain/mayanode!169 (merged)