Skip to content

Commit 7922c22

Browse files
authored
Merge pull request #71 from bnb-chain/develop
Prepare for release v1.0.2
2 parents 0ba000f + dc4cc14 commit 7922c22

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
@@ -485,14 +485,18 @@ impl PrecompileSpecId {
485485
PRAGUE | PRAGUE_EOF => Self::PRAGUE,
486486
#[cfg(feature = "optimism")]
487487
BEDROCK | REGOLITH | CANYON => Self::BERLIN,
488-
#[cfg(feature = "optimism")]
488+
#[cfg(all(feature = "optimism", not(feature = "opbnb")))]
489489
ECOTONE | FJORD => Self::CANCUN,
490+
#[cfg(all(feature = "optimism", feature = "opbnb"))]
491+
ECOTONE => Self::CANCUN,
490492
#[cfg(feature = "opbnb")]
491493
FERMAT => Self::FERMAT,
492494
#[cfg(any(feature = "bsc", feature = "opbnb"))]
493495
HABER => Self::HABER,
494496
#[cfg(feature = "opbnb")]
495497
WRIGHT => Self::HABER,
498+
#[cfg(all(feature = "optimism", feature = "opbnb"))]
499+
FJORD => Self::HABER,
496500
#[cfg(feature = "bsc")]
497501
HABER_FIX => Self::HABER,
498502
#[cfg(feature = "bsc")]

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
@@ -149,7 +149,7 @@ pub fn last_frame_return<SPEC: Spec, EXT, DB: Database>(
149149
pub fn load_precompiles<SPEC: Spec, EXT, DB: Database>() -> ContextPrecompiles<DB> {
150150
let mut precompiles = ContextPrecompiles::new(PrecompileSpecId::from_spec_id(SPEC::SPEC_ID));
151151

152-
if SPEC::enabled(SpecId::FJORD) {
152+
if SPEC::enabled(SpecId::FJORD) || SPEC::enabled(SpecId::HABER) {
153153
precompiles.extend([
154154
// EIP-7212: secp256r1 P256verify
155155
secp256r1::P256VERIFY,

0 commit comments

Comments
 (0)