Skip to content

Commit

Permalink
feat: implement precompile contract for opBNB (#6)
Browse files Browse the repository at this point in the history
* feat: implement precompile contract for opBNB

* fix: unused import warning in test

* ci: add develop branch to the list of branches to run

* chore: fmt codes

* chore: fix no default feature importing

* chore: cargo clippy fix

* ci: disable checks on riscv32imac-unknown-none-elf

* chore: setup vec with capacity

* fix: cometbft_light_block_validate input conversion

* chore: fix fmt

* fix: add opbnb feature to ECOTONE

* fix: sepc definition

* chore: fix opBNB feature tags

* chore(ci): bump action/deploy (#1372)

* fix: light block header validation in cometbft

* chore: fix fmt

* fix: BLS_SIGNATURE_VALIDATION_BASE to 1000

* update greenfield-cometbft-rs version

---------

Co-authored-by: rakita <rakita@users.noreply.github.com>
Co-authored-by: Keefe Liu <keefe.l@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 3, 2024
1 parent ae204d2 commit 9117570
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ negate-opbnb-default-handler = [
]
# Enables the BLS12-381 precompiles.
blst = ["dep:blst"]
opbnb = ["revm-primitives/opbnb"]
opbnb-default-handler = [
"opbnb",
"revm-primitives/opbnb-default-handler",
]
negate-opbnb-default-handler = [
"revm-primitives/negate-opbnb-default-handler",
]

[[bench]]
name = "bench"
Expand Down
1 change: 1 addition & 0 deletions crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub mod blake2;
mod bls;
#[cfg(feature = "blst")]
pub mod bls12_381;
mod bls;
pub mod bn128;
mod cometbft;
pub mod hash;
Expand Down
6 changes: 6 additions & 0 deletions crates/primitives/src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ spec!(ECOTONE, EcotoneSpec);
spec!(FERMAT, FermatSpec);
#[cfg(feature = "optimism")]
spec!(FJORD, FjordSpec);
#[cfg(feature = "opbnb")]
spec!(FERMAT, FermatSpec);

#[cfg(not(feature = "optimism"))]
#[macro_export]
Expand Down Expand Up @@ -374,6 +376,10 @@ macro_rules! spec_to_generic {
}
$crate::SpecId::FJORD => {
use $crate::FjordSpec as SPEC;
}
#[cfg(feature = "opbnb")]
$crate::SpecId::FERMAT => {
use $crate::FermatSpec as SPEC;
$e
}
}
Expand Down

0 comments on commit 9117570

Please sign in to comment.