From d3a6d4619296eaf12b1f5b1e0295ef65c3cace01 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Thu, 5 Sep 2024 10:48:17 -0300 Subject: [PATCH 1/2] witness: fix code touching Signed-off-by: Ignacio Hagopian --- core/state/access_witness.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state/access_witness.go b/core/state/access_witness.go index 54224b3cec3f..40d2e75cc33c 100644 --- a/core/state/access_witness.go +++ b/core/state/access_witness.go @@ -237,7 +237,7 @@ func (aw *AccessWitness) TouchCodeChunksRangeAndChargeGas(contractAddr []byte, s // reason that we do not need the last leaf is the account's code size // is already in the AccessWitness so a stateless verifier can see that // the code from the last leaf is not needed. - if (codeLen == 0 && size == 0) || startPC > codeLen { + if size == 0 || startPC > codeLen { return 0 } From dc807bf4f5c44102c71cb7e83ed30cf084475b69 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Thu, 5 Sep 2024 17:54:08 -0300 Subject: [PATCH 2/2] Update core/state/access_witness.go Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com> --- core/state/access_witness.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state/access_witness.go b/core/state/access_witness.go index 40d2e75cc33c..edb71123800e 100644 --- a/core/state/access_witness.go +++ b/core/state/access_witness.go @@ -237,7 +237,7 @@ func (aw *AccessWitness) TouchCodeChunksRangeAndChargeGas(contractAddr []byte, s // reason that we do not need the last leaf is the account's code size // is already in the AccessWitness so a stateless verifier can see that // the code from the last leaf is not needed. - if size == 0 || startPC > codeLen { + if size == 0 || startPC >= codeLen { return 0 }