From deb239d49ac12d02e19c62a52f5b67ff39ea351f Mon Sep 17 00:00:00 2001 From: airdropzamani Date: Fri, 4 Sep 2026 02:59:12 +0300 Subject: [PATCH 1/3] docs(pq-precompile): drop inaccurate Zero6-gated claim hardfork_flags is unused on the PQ dispatch path, so availability is not Zero6-gated at registration time. Align the address doc comment with that. --- crates/pq-precompile/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pq-precompile/src/lib.rs b/crates/pq-precompile/src/lib.rs index c6d5dfa..c7f244f 100644 --- a/crates/pq-precompile/src/lib.rs +++ b/crates/pq-precompile/src/lib.rs @@ -21,7 +21,7 @@ use revm_interpreter::gas::KECCAK256WORD; use revm_interpreter::Gas; use slh_dsa::{signature::Verifier, Sha2_128s, Signature, VerifyingKey as SlhDsaVerifyingKey}; -/// PQ precompile address — SLH-DSA-SHA2-128s signature verifier (Zero6-gated). +/// PQ precompile address — SLH-DSA-SHA2-128s signature verifier. pub const PQ_ADDRESS: Address = address!("1800000000000000000000000000000000000004"); /// Base gas for SLH-DSA-SHA2-128s verification. From 099c433b8f27316b97f6076fd6ab3349f799aaf5 Mon Sep 17 00:00:00 2001 From: airdropzamani Date: Fri, 4 Sep 2026 15:29:41 +0300 Subject: [PATCH 2/3] fix(precompiles): restore Zero6 registration gate for PQ The (Zero6-gated) doc was accurate: v0.7.x gated PQ at create_precompiles_map and v0.8.0 dropped that guard. Restore the registration-time check and the matched availability tests instead of deleting the comment. --- crates/pq-precompile/src/lib.rs | 2 +- crates/precompiles/src/precompile_provider.rs | 35 ++++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/crates/pq-precompile/src/lib.rs b/crates/pq-precompile/src/lib.rs index c7f244f..c6d5dfa 100644 --- a/crates/pq-precompile/src/lib.rs +++ b/crates/pq-precompile/src/lib.rs @@ -21,7 +21,7 @@ use revm_interpreter::gas::KECCAK256WORD; use revm_interpreter::Gas; use slh_dsa::{signature::Verifier, Sha2_128s, Signature, VerifyingKey as SlhDsaVerifyingKey}; -/// PQ precompile address — SLH-DSA-SHA2-128s signature verifier. +/// PQ precompile address — SLH-DSA-SHA2-128s signature verifier (Zero6-gated). pub const PQ_ADDRESS: Address = address!("1800000000000000000000000000000000000004"); /// Base gas for SLH-DSA-SHA2-128s verification. diff --git a/crates/precompiles/src/precompile_provider.rs b/crates/precompiles/src/precompile_provider.rs index 0ef69d7..8bcb38d 100644 --- a/crates/precompiles/src/precompile_provider.rs +++ b/crates/precompiles/src/precompile_provider.rs @@ -22,7 +22,7 @@ use crate::pq::{run_pq, PQ_ADDRESS}; use crate::system_accounting::{run_system_accounting, SYSTEM_ACCOUNTING_ADDRESS}; use alloy_evm::precompiles::PrecompilesMap; use alloy_primitives::Address; -use arc_execution_config::hardforks::ArcHardforkFlags; +use arc_execution_config::hardforks::{ArcHardfork, ArcHardforkFlags}; use reth_ethereum::evm::revm::precompile::PrecompileSpecId; use reth_ethereum::evm::revm::precompile::Precompiles; use reth_evm::precompiles::DynPrecompile; @@ -60,10 +60,16 @@ impl ArcPrecompileProvider { PrecompileId::Custom("SYSTEM_ACCOUNTING".into()), move |input| run_system_accounting(input, hardfork_flags), )), - PQ_ADDRESS => Some(DynPrecompile::new_stateful( - PrecompileId::Custom("PQ".into()), - move |input| run_pq(input, hardfork_flags), - )), + PQ_ADDRESS => { + // Only register PQ precompile if Zero6 hardfork is active + if !hardfork_flags.is_active(ArcHardfork::Zero6) { + return None; + } + Some(DynPrecompile::new_stateful( + PrecompileId::Custom("PQ".into()), + move |input| run_pq(input, hardfork_flags), + )) + } _ => handle_unknown_precompile(address), }); precompile_map @@ -117,15 +123,28 @@ mod tests { } #[test] - fn test_pq_precompile_available() { + fn test_pq_precompile_available_with_zero6() { let precompiles = ArcPrecompileProvider::create_precompiles_map( SpecId::PRAGUE, - ArcHardforkFlags::default(), + ArcHardforkFlags::with(&[ArcHardfork::Zero6]), ); assert!( precompiles.get(&PQ_ADDRESS).is_some(), - "PQ precompile should be available" + "PQ precompile should be available when Zero6 is active" + ); + } + + #[test] + fn test_pq_precompile_not_available_without_zero6() { + let precompiles = ArcPrecompileProvider::create_precompiles_map( + SpecId::PRAGUE, + ArcHardforkFlags::default(), + ); + + assert!( + precompiles.get(&PQ_ADDRESS).is_none(), + "PQ precompile should NOT be available without Zero6" ); } From 9cf11ae546abbee642cd71e2508bc80d954297f3 Mon Sep 17 00:00:00 2001 From: airdropzamani Date: Fri, 4 Sep 2026 23:57:21 +0300 Subject: [PATCH 3/3] docs(changelog): note Zero6 PQ registration gate restore Record the v0.8.0 regression fix so replay/bisect history stays legible. --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3955663..2929e37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to arc-node are documented in this file. +## [Unreleased] + +### Fixes + +- [EL] Restore Zero6 registration gate for the PQ precompile (regressed in v0.8.0); pre-Zero6 blocks no longer execute the verifier on replay + ## [v0.8.0] **Changes:** [v0.7.3...v0.8.0](https://github.com/circlefin/arc-node/compare/v0.7.3...v0.8.0) -- [release notes](https://github.com/circlefin/arc-node/releases/tag/v0.8.0)