Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: makes revm sp1 compatible through feature controlling #84

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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.

@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
@@ -408,7 +408,7 @@ fn encode_light_block_validation_result(
let mut output =
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

@@ -3,6 +3,8 @@
//! Implementations of EVM precompiled contracts.
#![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.

2 participants