Skip to content

Commit 6365fe9

Browse files
Update evm to v0.41.1 (polkadot-evm#1259) (#19)
Co-authored-by: Wei Tang <[email protected]>
1 parent 45d5f99 commit 6365fe9

File tree

11 files changed

+49
-46
lines changed

11 files changed

+49
-46
lines changed

Cargo.lock

Lines changed: 25 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ bn = { package = "substrate-bn", version = "0.6", default-features = false }
4949
clap = { version = "4.4.3", features = ["derive", "deprecated"] }
5050
derive_more = "0.99"
5151
environmental = { version = "1.1.4", default-features = false }
52-
ethereum = { version = "0.14.0", default-features = false }
52+
ethereum = { version = "0.15.0", default-features = false }
5353
ethereum-types = { version = "0.14.1", default-features = false }
54-
evm = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false }
54+
evm = { version = "0.41.1", default-features = false }
5555
futures = "0.3.28"
5656
hash-db = { version = "0.16.0", default-features = false }
5757
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }

frame/evm/precompile/dispatch/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ where
8585
return Err(err);
8686
}
8787

88-
handle
89-
.record_external_cost(Some(info.weight.ref_time()), Some(info.weight.proof_size()))?;
88+
handle.record_external_cost(
89+
Some(info.weight.ref_time()),
90+
Some(info.weight.proof_size()),
91+
None,
92+
)?;
9093

9194
match call.dispatch(Some(origin).into()) {
9295
Ok(post_info) => {

frame/evm/precompile/dispatch/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ impl PrecompileHandle for MockHandle {
183183
&mut self,
184184
_ref_time: Option<u64>,
185185
_proof_size: Option<u64>,
186+
_storage_growth: Option<u64>,
186187
) -> Result<(), ExitError> {
187188
Ok(())
188189
}

frame/evm/src/runner/stack.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ where
999999
ExternalOperation::IsEmpty => {
10001000
weight_info.try_record_proof_size_or_fail(IS_EMPTY_CHECK_PROOF_SIZE)?
10011001
}
1002-
ExternalOperation::Write => {
1002+
ExternalOperation::Write(_) => {
10031003
weight_info.try_record_proof_size_or_fail(WRITE_PROOF_SIZE)?
10041004
}
10051005
};
@@ -1138,6 +1138,7 @@ where
11381138
&mut self,
11391139
ref_time: Option<u64>,
11401140
proof_size: Option<u64>,
1141+
_storage_growth: Option<u64>,
11411142
) -> Result<(), ExitError> {
11421143
let weight_info = if let (Some(weight_info), _) = self.info_mut() {
11431144
weight_info

frame/evm/test-vector-support/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ impl PrecompileHandle for MockHandle {
8080
Ok(())
8181
}
8282

83-
fn record_external_cost(&mut self, _: Option<u64>, _: Option<u64>) -> Result<(), ExitError> {
83+
fn record_external_cost(
84+
&mut self,
85+
_: Option<u64>,
86+
_: Option<u64>,
87+
_: Option<u64>,
88+
) -> Result<(), ExitError> {
8489
Ok(())
8590
}
8691

precompiles/src/evm/handle.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<T: PrecompileHandle> PrecompileHandleExt for T {
6060
) -> Result<(), evm::ExitError> {
6161
self.record_cost(crate::prelude::RuntimeHelper::<Runtime>::db_read_gas_cost())?;
6262
// TODO: record ref time when precompile will be benchmarked
63-
self.record_external_cost(None, Some(data_max_encoded_len as u64))
63+
self.record_external_cost(None, Some(data_max_encoded_len as u64), None)
6464
}
6565

6666
/// Record cost of a log manualy.
@@ -190,6 +190,7 @@ mod tests {
190190
&mut self,
191191
_ref_time: Option<u64>,
192192
_proof_size: Option<u64>,
193+
_storage_growth: Option<u64>,
193194
) -> Result<(), fp_evm::ExitError> {
194195
Ok(())
195196
}

precompiles/src/precompile_set.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,10 @@ impl<'a, H: PrecompileHandle> PrecompileHandle for RestrictiveHandle<'a, H> {
477477
&mut self,
478478
ref_time: Option<u64>,
479479
proof_size: Option<u64>,
480+
storage_growth: Option<u64>,
480481
) -> Result<(), ExitError> {
481-
self.handle.record_external_cost(ref_time, proof_size)
482+
self.handle
483+
.record_external_cost(ref_time, proof_size, storage_growth)
482484
}
483485

484486
fn refund_external_cost(&mut self, ref_time: Option<u64>, proof_size: Option<u64>) {

precompiles/src/substrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ where
7777

7878
// Make sure there is enough remaining weight
7979
// TODO: record ref time when precompile will be benchmarked
80-
handle.record_external_cost(None, Some(weight.proof_size()))
80+
handle.record_external_cost(None, Some(weight.proof_size()), None)
8181
}
8282

8383
#[inline(always)]

precompiles/src/testing/handle.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ impl PrecompileHandle for MockHandle {
208208
&mut self,
209209
_ref_time: Option<u64>,
210210
_proof_size: Option<u64>,
211+
_storage_growth: Option<u64>,
211212
) -> Result<(), ExitError> {
212213
Ok(())
213214
}

0 commit comments

Comments
 (0)