Skip to content

Commit

Permalink
remove address_high (scroll-tech#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamWuGit authored Oct 25, 2023
1 parent 188396d commit 3f3b54a
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions zkevm-circuits/src/evm_circuit/util/memory_gadget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,7 @@ use itertools::Itertools;

/// Decodes the usable part of an address stored in a Word
pub(crate) mod address_low {
use crate::evm_circuit::{
param::N_BYTES_MEMORY_ADDRESS,
util::{from_bytes, Word},
};
use eth_types::Field;
use halo2_proofs::plonk::Expression;

pub(crate) fn expr<F: Field>(address: &Word<F>) -> Expression<F> {
from_bytes::expr(&address.cells[..N_BYTES_MEMORY_ADDRESS])
}
use crate::evm_circuit::param::N_BYTES_MEMORY_ADDRESS;

pub(crate) fn value(address: [u8; 32]) -> u64 {
let mut bytes = [0; 8];
Expand All @@ -50,25 +41,6 @@ pub(crate) mod address_low {
}
}

/// The sum of bytes of the address that are unused for most calculations on the
/// address
pub(crate) mod address_high {
use crate::evm_circuit::{
param::N_BYTES_MEMORY_ADDRESS,
util::{from_bytes, Word},
};
use eth_types::Field;
use halo2_proofs::plonk::Expression;

pub(crate) fn expr<F: Field>(address: &Word<F>) -> Expression<F> {
from_bytes::expr(&address.cells[N_BYTES_MEMORY_ADDRESS..])
}

pub(crate) fn value<F: Field>(address: [u8; 32]) -> F {
from_bytes::value::<F>(&address[N_BYTES_MEMORY_ADDRESS..])
}
}

/// Memory address trait to adapt for right and Uint overflow cases.
pub(crate) trait CommonMemoryAddressGadget<F: FieldExt> {
fn construct_self(cb: &mut EVMConstraintBuilder<F>) -> Self;
Expand Down

0 comments on commit 3f3b54a

Please sign in to comment.