You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to validate transitions from the client wallet, the NitroAdjudicator should expose Rules.validTransition.
The naive method
function validTransition(
Commitment.CommitmentStruct memory agreedCommitment,
Commitment.CommitmentStruct memory challengeCommitment
) public pure returns (bool) {
return Rules.validTransition(agreedCommitment, challengeCommitment);
}
seems to require an infinite amount of gas to deploy. I've managed to exceed 8 000 000 000 -- the gas limit on mainnet is currently around 8 000 000.
Setting the gas limit to a googol causes the migrations script to fail silently, perhaps due to truffle or ganache not properly handling numbers greater than 2^256.
The following method, with an unused Signature[] memory argument, works, requiring ~6500000 gas
function validTransition(
Commitment.CommitmentStruct memory agreedCommitment,
Commitment.CommitmentStruct memory challengeCommitment,
Signature[] memory unusedArg
) public pure returns (bool) {
return Rules.validTransition(agreedCommitment, challengeCommitment);
}
The following method, with an unused uint[] memory argument also uses at least 8 billion gas:
function validTransition(
Commitment.CommitmentStruct memory agreedCommitment,
Commitment.CommitmentStruct memory challengeCommitment,
uint[] memory unusedArg
) public pure returns (bool) {
return Rules.validTransition(agreedCommitment, challengeCommitment);
}
I thought perhaps any array of an arbitrary user-defined struct would work, but this one also uses at least 8 billion gas.
struct SimpleStruct {
bool flag;
}
function validTransition(
Commitment.CommitmentStruct memory agreedCommitment,
Commitment.CommitmentStruct memory challengeCommitment,
SimpleStruct[] memory unusedArg
) public pure returns (bool) {
return Rules.validTransition(agreedCommitment, challengeCommitment);
}
The text was updated successfully, but these errors were encountered:
I've recorded a couple of the above examples in the solidity-bug branch. Note that the block-gas-limit is the default truffle/ganache value of 6721975. Deploying the TestNitroAdjudicator does use almost that much gas.
In order to validate transitions from the client wallet, the NitroAdjudicator should expose
Rules.validTransition
.The naive method
seems to require an infinite amount of gas to deploy. I've managed to exceed 8 000 000 000 -- the gas limit on mainnet is currently around 8 000 000.
Setting the gas limit to a googol causes the migrations script to fail silently, perhaps due to truffle or ganache not properly handling numbers greater than 2^256.
The following method, with an unused
Signature[] memory
argument, works, requiring ~6500000 gasThe following method, with an unused
uint[] memory
argument also uses at least 8 billion gas:I thought perhaps any array of an arbitrary user-defined struct would work, but this one also uses at least 8 billion gas.
The text was updated successfully, but these errors were encountered: