|
|
@ -190,19 +190,21 @@ public class AccessWitness implements org.hyperledger.besu.datatypes.AccessWitne |
|
|
|
if ((readSize == 0 && codeLength == 0) || startPc > codeLength) { |
|
|
|
if ((readSize == 0 && codeLength == 0) || startPc > codeLength) { |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
long endPc = startPc+readSize; |
|
|
|
long endPc = startPc + readSize; |
|
|
|
if(endPc>codeLength){ |
|
|
|
if (endPc > codeLength) { |
|
|
|
endPc = codeLength; |
|
|
|
endPc = codeLength; |
|
|
|
} |
|
|
|
} |
|
|
|
if(endPc>0){ |
|
|
|
if (endPc > 0) { |
|
|
|
endPc-=1; |
|
|
|
endPc -= 1; |
|
|
|
} |
|
|
|
} |
|
|
|
for (long i = startPc / 31; i <= endPc/31; i++) { |
|
|
|
for (long i = startPc / 31; i <= endPc / 31; i++) { |
|
|
|
gas = clampedAdd(gas, |
|
|
|
gas = |
|
|
|
touchAddressOnReadAndComputeGas( |
|
|
|
clampedAdd( |
|
|
|
address, |
|
|
|
gas, |
|
|
|
CODE_OFFSET.add(i).divide(VERKLE_NODE_WIDTH), |
|
|
|
touchAddressOnReadAndComputeGas( |
|
|
|
CODE_OFFSET.add(i).mod(VERKLE_NODE_WIDTH))); |
|
|
|
address, |
|
|
|
|
|
|
|
CODE_OFFSET.add(i).divide(VERKLE_NODE_WIDTH), |
|
|
|
|
|
|
|
CODE_OFFSET.add(i).mod(VERKLE_NODE_WIDTH))); |
|
|
|
} |
|
|
|
} |
|
|
|
return gas; |
|
|
|
return gas; |
|
|
|
} |
|
|
|
} |
|
|
|