Skip to content

Commit

Permalink
fixed issue with cds and ecpairing
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzogentile404 committed Jan 30, 2025
1 parent 53fc186 commit d8ce0ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -941,13 +941,13 @@ private void setEcpairing(PrecompileCommonOobCall prcCommonOobCall) {
insufficientGas =
callToLT(
4, BigInteger.ZERO, prcCommonOobCall.getCalleeGas(), BigInteger.ZERO, precompileCost);
insufficientGasForPrecompile = insufficientGas;
} else {
noCall(4);
}

// Set hubSuccess
final boolean hubSuccess = isMultipleOf192 && !insufficientGas;
insufficientGasForPrecompile = !hubSuccess; // TODO: this is for testing purposes, not accurate
prcCommonOobCall.setHubSuccess(hubSuccess);

// Set returnGas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ void lowGasStipendPrecompileCallTest(Address precompileAddress, boolean isZeroAr
BytecodeCompiler.newProgram()
.push(isZeroArgument ? 0 : 1) // retSize
.push(isZeroArgument ? 0 : 1) // retOffset
.push(isZeroArgument ? 0 : 1) // argsSize
.push(
isZeroArgument
? 0
: (precompileAddress == Address.ALTBN128_PAIRING ? 192 : 1)) // argsSize
.push(isZeroArgument ? 0 : 1) // argsOffset
.push(0) // value
.push(precompileAddress) // address
Expand Down

0 comments on commit d8ce0ff

Please sign in to comment.