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

refactor(interpreter): use the constants from primitives #861

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/interpreter/src/instructions/host.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::interpreter::InterpreterAction;
use crate::primitives::{Address, Bytes, Spec, SpecId::*, B256, U256};
use crate::MAX_INITCODE_SIZE;
use crate::primitives::{Address, Bytes, Spec, SpecId::*, B256, MAX_INITCODE_SIZE, U256};
use crate::{
gas::{self, COLD_ACCOUNT_ACCESS_COST, WARM_STORAGE_READ_COST},
interpreter::Interpreter,
Expand Down
8 changes: 0 additions & 8 deletions crates/interpreter/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ use revm_primitives::{Address, U256};

pub use self::shared_memory::EMPTY_SHARED_MEMORY;

/// EIP-170: Contract code size limit
///
/// By default this limit is 0x6000 (~25kb)
pub const MAX_CODE_SIZE: usize = 0x6000;

/// EIP-3860: Limit and meter initcode
pub const MAX_INITCODE_SIZE: usize = 2 * MAX_CODE_SIZE;

#[derive(Debug)]
pub struct Interpreter {
/// Contract information and invoking data
Expand Down
5 changes: 3 additions & 2 deletions crates/interpreter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ pub use instruction_result::*;
pub use instructions::{opcode, Instruction, OpCode, OPCODE_JUMPMAP};
pub use interpreter::{
analysis, next_multiple_of_32, BytecodeLocked, Contract, Interpreter, InterpreterAction,
InterpreterResult, SharedMemory, Stack, EMPTY_SHARED_MEMORY, MAX_CODE_SIZE, MAX_INITCODE_SIZE,
STACK_LIMIT,
InterpreterResult, SharedMemory, Stack, EMPTY_SHARED_MEMORY, STACK_LIMIT,
};
pub use primitives::{MAX_CODE_SIZE, MAX_INITCODE_SIZE};

#[doc(hidden)]
pub use revm_primitives as primitives;
Loading