Skip to content

Commit

Permalink
Merge pull request #152 from ralexstokes/signing-refactor
Browse files Browse the repository at this point in the history
simplify fork version handling from `ethereum-consensus`
  • Loading branch information
ralexstokes authored Oct 17, 2023
2 parents 1128475 + a5e0ca0 commit 673f9b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ default-members = ["bin/mev"]
version = "0.3.0"

[workspace.dependencies]
ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "e810cecbb113de66aeedae6dcde2a69cd284f88d" }
beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "e810cecbb113de66aeedae6dcde2a69cd284f88d" }
ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "bfb6af698311226d55ec7c7ba6eabbc1abc072a0" }
beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "bfb6af698311226d55ec7c7ba6eabbc1abc072a0" }

reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "1b16d804ef01f4ec3c25e7986381c22739c105b9" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "1b16d804ef01f4ec3c25e7986381c22739c105b9" }
Expand Down
10 changes: 3 additions & 7 deletions mev-rs/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ethereum_consensus::{
signing::sign_with_domain,
ssz::prelude::Merkleized,
state_transition::Context,
Error, Fork,
Error,
};
pub use ethereum_consensus::{
crypto::SecretKey,
Expand All @@ -19,12 +19,8 @@ pub fn compute_consensus_signing_root<T: Merkleized>(
genesis_validators_root: &Root,
context: &Context,
) -> Result<Root, Error> {
let fork_version = match context.fork_for(slot) {
Fork::Bellatrix => context.bellatrix_fork_version,
Fork::Capella => context.capella_fork_version,
Fork::Deneb => context.deneb_fork_version,
_ => unimplemented!("fork not supported"),
};
let fork = context.fork_for(slot);
let fork_version = context.fork_version_for(fork);
let domain = compute_domain(
DomainType::BeaconProposer,
Some(fork_version),
Expand Down

0 comments on commit 673f9b2

Please sign in to comment.