diff --git a/core/state/intra_block_state.go b/core/state/intra_block_state.go index a4682215282..b79bf96dfdc 100644 --- a/core/state/intra_block_state.go +++ b/core/state/intra_block_state.go @@ -260,6 +260,10 @@ func (sdb *IntraBlockState) GetCodeHash(addr libcommon.Address) libcommon.Hash { if stateObject == nil || stateObject.deleted { return libcommon.Hash{} } + + // Plonky2: if the code is not nil, we need to include code in the witness by calling GetCodeSize + sdb.GetCodeSize(addr) + return libcommon.BytesToHash(stateObject.CodeHash()) }