Skip to content

Conversation

@ZhAnGeek
Copy link

@ZhAnGeek ZhAnGeek commented Nov 6, 2024

Description

makes revm sp1 compatible through feature controlling

Rationale

adapt revm to be compilable for risv32 and so as to prove opbnb blocks

Changes

  • cometbft default features set to false to disable cometbft-rpc http-client feature.
  • tendermint set to optional, and removed tendermint dependency when the feature does not contain bsc.
  • export opbnb precompile cometbft_light_block_validation and bls_signature_validation and their mods.

j75689 and others added 30 commits May 21, 2024 11:52
* 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 <[email protected]>
Co-authored-by: Keefe Liu <[email protected]>
* feat(optimism): Add secp256r1 precompile for Fjord (#1436)

* feat(optimism): Add secp256r1 precompile for Fjord

* Fix docs

* Fix nostd build

* Load fjord precompiles via optimism handler register

* Remove outdated fjord() precompile spec constructor

* Document the secp256r1 feature

* Address feedback

* Handle invalid signatures

* Update crates/precompile/src/secp256r1.rs

* Update crates/precompile/src/secp256r1.rs

* Blank return on failed signature verification

* Add test case for invalid (zero) pubkey

---------

Co-authored-by: rakita <[email protected]>

* feat: add Haber spec to opBNB

---------

Co-authored-by: Brian Bland <[email protected]>
Co-authored-by: rakita <[email protected]>
# Conflicts:
#	.github/workflows/book.yml
#	.github/workflows/cachegrind.yml
#	Cargo.lock
#	crates/interpreter/src/instructions/opcode.rs
#	crates/precompile/Cargo.toml
#	crates/precompile/src/lib.rs
#	crates/primitives/src/specification.rs
#	crates/revm/src/optimism/handler_register.rs
chore: merge upstream changes into develop
* feat: add support for BSC

* fix precompile contracts error

* optimize `specification` setting

* fix lint issues

* fix CI issues

* fix CI issues

* fix CI issues

* fix wrong precompile contracts set

* fix precompile revert error

* add check for bsc precompile

* add `PrecompileError::Reverted`

* fix evm spec for `KEPLER`

* fix CI issues

* add `haber` precompile set and fix errors

* add EIP4844 data fee to `collect_system_reward`

* update bsc feature dep

* fix review comments

* update `tendermint` version
# Conflicts:
#	Cargo.lock
#	crates/precompile/Cargo.toml
#	crates/precompile/src/lib.rs
#	crates/revm/src/context/evm_context.rs
chore: merge v37 version into develop
# Conflicts:
#	.github/workflows/ci.yml
#	Cargo.lock
#	crates/precompile/Cargo.toml
#	crates/precompile/src/lib.rs
* feat: add bohr upgrade for BSC

* fix lint error

* fix lint error

* fix lint error
* defer bytecode load

* apply review
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](bitflags/bitflags@2.5.0...2.6.0)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.203...v1.0.204)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.117 to 1.0.120.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](serde-rs/json@v1.0.117...v1.0.120)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: use `kzg-rs`

* fix: use `c-kzg` by default in std env

* refactor: feature gate by `c-kzg`

* fix: use published crate

* fix: `kzg-rs` import

* feat: use `cfg_if` for `kzg-rs` imports

* feat: use `kzg-rs`

* fix: `kzg-rs` import

* chore: add `kzg-rs` feature to revm-interpreter

* fix: check kzg-rs enable in revm/precompile

* fix: kzg-rs include once_cell and derive_more in primitives, update feature tags

* Update crates/primitives/src/lib.rs

* Update crates/precompile/src/lib.rs

* Update crates/primitives/Cargo.toml

* Update crates/revm/Cargo.toml

* Update crates/precompile/Cargo.toml

* Update crates/primitives/src/lib.rs

---------

Co-authored-by: rakita <[email protected]>
…1600)

* chore: Refactor code, and check is precompile for create colision

* remove some TODOs for eofcreate nonce
* fix(EOF): MIN_CALLEE_GAS light failure, static-mode check

* clear buffer

* readd min caller gas
@ZhAnGeek ZhAnGeek force-pushed the feat--makes-revm-sp1-compatible-through-feature-controlling branch 7 times, most recently from 3de530c to 39dde2a Compare November 6, 2024 09:37
@ZhAnGeek ZhAnGeek force-pushed the feat--makes-revm-sp1-compatible-through-feature-controlling branch from 39dde2a to 52c7199 Compare November 6, 2024 09:52
@ZhAnGeek ZhAnGeek force-pushed the feat--makes-revm-sp1-compatible-through-feature-controlling branch 2 times, most recently from eb6eb74 to 88c3a49 Compare November 11, 2024 07:54
@ZhAnGeek ZhAnGeek force-pushed the feat--makes-revm-sp1-compatible-through-feature-controlling branch from 88c3a49 to b8d59fa Compare November 11, 2024 08:08
vec![0; (VALIDATE_RESULT_METADATA_LENGTH + consensus_state_bytes.len() as u64) as usize];
output[0] = if validator_set_changed { 1 } else { 0 };
output[24..32].copy_from_slice(consensus_state_bytes.len().to_be_bytes().as_ref());
output[24..32].copy_from_slice((consensus_state_bytes.len() as u64).to_be_bytes().as_ref());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compatibility for 32-bit system, risv32 running panic for this line due to mismatch len

#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(unused_mut)]
#![allow(unused_crate_dependencies)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better remove this to keep deps clean

@ZhAnGeek ZhAnGeek force-pushed the feat--makes-revm-sp1-compatible-through-feature-controlling branch 4 times, most recently from ee7ce1b to 14d8659 Compare November 12, 2024 11:37
@ZhAnGeek ZhAnGeek force-pushed the feat--makes-revm-sp1-compatible-through-feature-controlling branch from 14d8659 to 3dff0d3 Compare November 12, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.