Skip to content

Commit b8318b3

Browse files
committed
Merge remote-tracking branch 'origin/develop' into merge_merge-v14.0.0
2 parents d7b7e71 + dc4cc14 commit b8318b3

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

crates/interpreter/src/function_stack.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ impl FunctionStack {
5151

5252
/// Pops a frame from the stack and sets current_code_idx to the popped frame's idx.
5353
pub fn pop(&mut self) -> Option<FunctionReturnFrame> {
54-
self.return_stack.pop().map(|frame| {
54+
self.return_stack.pop().inspect(|frame| {
5555
self.current_code_idx = frame.idx;
56-
frame
5756
})
5857
}
5958

crates/precompile/src/bls.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn bls_signature_validation_run(input: &Bytes, gas_limit: u64) -> PrecompileResu
6464
if (pub_keys.len() == 1 && !bls::verify(&pub_keys[0], msg_hash, signature, &BLS_DST.to_vec()))
6565
|| !bls::aggregate_verify(pub_keys, msg_hashes, signature, &BLS_DST.to_vec())
6666
{
67-
output = Bytes::from(vec![0]);
67+
output = Bytes::from(vec![]);
6868
}
6969

7070
Ok(PrecompileOutput::new(cost, output))
@@ -118,7 +118,7 @@ mod tests {
118118
input.extend_from_slice(&signature);
119119
input.extend_from_slice(&pub_key);
120120

121-
let excepted_output = Bytes::from(vec![0]);
121+
let excepted_output = Bytes::from(vec![]);
122122
let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) {
123123
Ok(o) => o.bytes,
124124
Err(e) => panic!("BLS signature validation failed, {:?}", e),
@@ -187,7 +187,7 @@ mod tests {
187187
input.extend_from_slice(&pub_key1);
188188
input.extend_from_slice(&pub_key2);
189189
input.extend_from_slice(&pub_key3);
190-
let excepted_output = Bytes::from(vec![0]);
190+
let excepted_output = Bytes::from(vec![]);
191191
let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) {
192192
Ok(o) => o.bytes,
193193
Err(e) => panic!("BLS signature validation failed, {:?}", e),
@@ -242,7 +242,7 @@ mod tests {
242242
input.extend_from_slice(&pub_key1);
243243
input.extend_from_slice(&pub_key2);
244244
input.extend_from_slice(&pub_key3);
245-
let excepted_output = Bytes::from(vec![0]);
245+
let excepted_output = Bytes::from(vec![]);
246246
let result = match bls_signature_validation_run(&Bytes::from(input.clone()), 100_000_000) {
247247
Ok(o) => o.bytes,
248248
Err(e) => panic!("BLS signature validation failed, {:?}", e),

crates/precompile/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,14 +486,18 @@ impl PrecompileSpecId {
486486
PRAGUE | PRAGUE_EOF => Self::PRAGUE,
487487
#[cfg(feature = "optimism")]
488488
BEDROCK | REGOLITH | CANYON => Self::BERLIN,
489-
#[cfg(feature = "optimism")]
489+
#[cfg(all(feature = "optimism", not(feature = "opbnb")))]
490490
ECOTONE | FJORD | GRANITE => Self::CANCUN,
491+
#[cfg(all(feature = "optimism", feature = "opbnb"))]
492+
ECOTONE | GRANITE => Self::CANCUN,
491493
#[cfg(feature = "opbnb")]
492494
FERMAT => Self::FERMAT,
493495
#[cfg(any(feature = "bsc", feature = "opbnb"))]
494496
HABER => Self::HABER,
495497
#[cfg(feature = "opbnb")]
496498
WRIGHT => Self::HABER,
499+
#[cfg(all(feature = "optimism", feature = "opbnb"))]
500+
FJORD => Self::HABER,
497501
#[cfg(feature = "bsc")]
498502
HABER_FIX | BOHR => Self::HABER,
499503
LATEST => Self::LATEST,

crates/revm/src/evm.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,8 @@ impl<EXT, DB: Database> Evm<'_, EXT, DB> {
199199
.handler
200200
.validation()
201201
.initial_tx_gas(&self.context.evm.env)
202-
.map_err(|e| {
202+
.inspect_err(|_| {
203203
self.clear();
204-
e
205204
})?;
206205
let output = self.transact_preverified_inner(initial_gas_spend);
207206
let output = self.handler.post_execution().end(&mut self.context, output);
@@ -228,9 +227,8 @@ impl<EXT, DB: Database> Evm<'_, EXT, DB> {
228227
/// This function will validate the transaction.
229228
#[inline]
230229
pub fn transact(&mut self) -> EVMResult<DB::Error> {
231-
let initial_gas_spend = self.preverify_transaction_inner().map_err(|e| {
230+
let initial_gas_spend = self.preverify_transaction_inner().inspect_err(|_| {
232231
self.clear();
233-
e
234232
})?;
235233

236234
let output = self.transact_preverified_inner(initial_gas_spend);

crates/revm/src/optimism/handler_register.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub fn refund<SPEC: Spec, EXT, DB: Database>(
165165
pub fn load_precompiles<SPEC: Spec, EXT, DB: Database>() -> ContextPrecompiles<DB> {
166166
let mut precompiles = ContextPrecompiles::new(PrecompileSpecId::from_spec_id(SPEC::SPEC_ID));
167167

168-
if SPEC::enabled(SpecId::FJORD) {
168+
if SPEC::enabled(SpecId::FJORD) || SPEC::enabled(SpecId::HABER) {
169169
precompiles.extend([
170170
// EIP-7212: secp256r1 P256verify
171171
secp256r1::P256VERIFY,

0 commit comments

Comments
 (0)