-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add frontier evm #1133
feat: add frontier evm #1133
Conversation
03d2a84
to
96890df
Compare
Signed-off-by: Gregory Hill <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me, but honestly it's very difficult to review, because there's so much code involved..
One question I do have is, how can the evm interact with our runtime? E.g. if it wants to check a bitcoin inclusion?
pub mod precompiles; | ||
|
||
/// Current approximation of the gas/s consumption (Moonbeam) | ||
pub const GAS_PER_SECOND: u64 = 40_000_000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to benchmark this somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure, but this is where Moonbeam defines it: https://github.com/moonbeam-foundation/moonbeam/blob/c55870bdda5bd40e97daffc27a5e3e1c037c5da9/runtime/moonbeam/src/lib.rs#L365-L369
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK that is used in production and Centrifuge also copied that for their runtime.
pub type AccountConverter = HashedAddressMapping<BlakeTwo256>; | ||
|
||
parameter_types! { | ||
pub DefaultBaseFeePerGas: U256 = U256::from(CENTS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "flipper" contract fixture costs 133751 gas to create which would total (133751 * (10**10 / 100)) / 10**10 = 1337.51 INTR ($19.7)
.
pub type AccountConverter = HashedAddressMapping<BlakeTwo256>; | ||
|
||
parameter_types! { | ||
pub DefaultBaseFeePerGas: U256 = U256::from(CENTS * 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "flipper" contract fixture costs 133751 gas to create which would total (133751 * (10**12 / 30_000 * 10)) / 10**12 = 44.58 KINT ($16.94)
.
We need to add precompiles, see for example Acala's |
Closes #1098
TODO
TransactionConverter
)Adds the following pallets to the
interlay
andkintsugi
runtimes in addition to those required for RPC compatibility.BaseFee
(pallet_base_fee
)Controls the price per gas unit, updates based on the weight of the previous block - decreases if below or increases if above the target.
Ethereum
(pallet_ethereum
)Emulation for block processing, validates and stores (EVM) transactions then constructs the Ethereum compatible block
on_finalize
.EVM
(pallet_evm
)Contains the
SputnikVM
to execute EVM bytecode compatible with the Ethereum mainnet.Configuration
HashedAddressMapping
EVMChainId
(pallet_evm_chain_id
)Stores the chain ID which is used by the EVM runner.