From ecd2f2003489ce9aebf28fbaa02a035dc1f671a9 Mon Sep 17 00:00:00 2001 From: Robin Salen <30937548+Nashtare@users.noreply.github.com> Date: Sun, 28 Jul 2024 08:51:30 -0400 Subject: [PATCH] Increase MAXCODESIZE for Polygon PoS (#419) --- evm_arithmetization/Cargo.toml | 1 + evm_arithmetization/src/cpu/kernel/constants/mod.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/evm_arithmetization/Cargo.toml b/evm_arithmetization/Cargo.toml index 45e9ccb8f..7398aee08 100644 --- a/evm_arithmetization/Cargo.toml +++ b/evm_arithmetization/Cargo.toml @@ -61,6 +61,7 @@ parallel = [ "plonky2_maybe_rayon/parallel", "starky/parallel", ] +polygon_pos = [] [[bin]] name = "assemble" diff --git a/evm_arithmetization/src/cpu/kernel/constants/mod.rs b/evm_arithmetization/src/cpu/kernel/constants/mod.rs index 3bd99f610..65d6418b3 100644 --- a/evm_arithmetization/src/cpu/kernel/constants/mod.rs +++ b/evm_arithmetization/src/cpu/kernel/constants/mod.rs @@ -337,7 +337,10 @@ const PRECOMPILES_GAS: [(&str, u16); 14] = [ const SNARKV_POINTERS: [(&str, u64); 2] = [("SNARKV_INP", 112), ("SNARKV_OUT", 100)]; const CODE_SIZE_LIMIT: [(&str, u64); 3] = [ - ("MAX_CODE_SIZE", 0x6000), + #[cfg(not(feature = "polygon_pos"))] + ("MAX_CODE_SIZE", 0x6000), // default Ethereum value + #[cfg(feature = "polygon_pos")] + ("MAX_CODE_SIZE", 0x8000), // Polygon PoS value, see PIP-30. ("MAX_INITCODE_SIZE", 0xc000), ("INITCODE_WORD_COST", 2), ];