From 2ebca53bd662884ddd97a85a9ee7ff329053a51c Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Fri, 3 Jul 2026 20:00:00 +0800 Subject: [PATCH] core/vm/runtime: propagate SlotNum to EVM block context Expose SlotNum in runtime.Config so the SLOTNUM opcode returns the expected value when executing via the runtime package. --- core/vm/runtime/env.go | 1 + core/vm/runtime/runtime.go | 1 + 2 files changed, 2 insertions(+) diff --git a/core/vm/runtime/env.go b/core/vm/runtime/env.go index de3e8d4ae2..afd14e73cd 100644 --- a/core/vm/runtime/env.go +++ b/core/vm/runtime/env.go @@ -41,6 +41,7 @@ func NewEnv(cfg *Config) *vm.EVM { BaseFee: cfg.BaseFee, BlobBaseFee: cfg.BlobBaseFee, Random: cfg.Random, + SlotNum: cfg.SlotNum, CostPerStateByte: params.CostPerStateByte, } diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 9a15f7ac96..c3d3cf8f6c 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -49,6 +49,7 @@ type Config struct { BlobHashes []common.Hash BlobFeeCap *big.Int Random *common.Hash + SlotNum uint64 State *state.StateDB GetHashFn func(n uint64) common.Hash