Skip to content

Commit

Permalink
add eip-4399 ref: rust-ethereum/evm#162
Browse files Browse the repository at this point in the history
  • Loading branch information
zjb0807 committed Jan 17, 2024
1 parent 5a41d40 commit 05f6418
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions modules/evm-utility/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ sha3 = { workspace = true }

sp-std = { workspace = true }

evm = { git = "https://github.com/rust-blockchain/evm", rev = "e7138f7234b117d29d4e653da4967d76e51c5eaf", default-features = false, features = ["with-codec"] }
evm-gasometer = { git = "https://github.com/rust-blockchain/evm", rev = "e7138f7234b117d29d4e653da4967d76e51c5eaf", default-features = false }
evm-runtime = { git = "https://github.com/rust-blockchain/evm", rev = "e7138f7234b117d29d4e653da4967d76e51c5eaf", default-features = false }
evm = { git = "https://github.com/rust-blockchain/evm", rev = "21972c2392af3381bbfcd2139664ba3fff0ee287", default-features = false, features = ["with-codec"] }
evm-gasometer = { git = "https://github.com/rust-blockchain/evm", rev = "21972c2392af3381bbfcd2139664ba3fff0ee287", default-features = false }
evm-runtime = { git = "https://github.com/rust-blockchain/evm", rev = "21972c2392af3381bbfcd2139664ba3fff0ee287", default-features = false }
#evm = { version = "0.41.1", default-features = false, features = ["with-codec"] }
#evm-gasometer = { version = "0.41.0", default-features = false }
#evm-runtime = { version = "0.41.0", default-features = false }
Expand Down
4 changes: 4 additions & 0 deletions modules/evm/src/runner/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,10 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity,
self.vicinity.origin
}

fn block_randomness(&self) -> Option<H256> {
None
}

fn block_hash(&self, number: U256) -> H256 {
if number > U256::from(u32::MAX) {
H256::default()
Expand Down
8 changes: 7 additions & 1 deletion modules/evm/src/runner/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,10 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu
}

/// Execute using Runtimes on the call_stack until it returns.
fn execute_with_call_stack(&mut self, call_stack: &mut Vec<TaggedRuntime>) -> (ExitReason, Option<H160>, Vec<u8>) {
fn execute_with_call_stack(
&mut self,
call_stack: &mut Vec<TaggedRuntime<'_>>,
) -> (ExitReason, Option<H160>, Vec<u8>) {
// This `interrupt_runtime` is used to pass the runtime obtained from the
// `Capture::Trap` branch in the match below back to the top of the call stack.
// The reason we can't simply `push` the runtime directly onto the stack in the
Expand Down Expand Up @@ -1279,6 +1282,9 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> Handler
fn block_difficulty(&self) -> U256 {
self.state.block_difficulty()
}
fn block_randomness(&self) -> Option<H256> {
self.state.block_randomness()
}
fn block_gas_limit(&self) -> U256 {
self.state.block_gas_limit()
}
Expand Down

0 comments on commit 05f6418

Please sign in to comment.