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
{{ message }}
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
We have Frontend contracts that provide convenient methods for the client to perform state transitions or signature validation.
The validate method of the Frontend contracts for Transfer validates the signature of a Transfer transaction. It depends on verifySingle method of the BLS library, which depends on getGasCost method of the BNPairingPrecompileCostEstimator.
Before the BNPairingPrecompileCostEstimator is deployed, the frontendTransfer.validate should fail since the BLS.verifySingle is falling to get the gasCost estimate from the BNPairingPrecompileCostEstimator.getGasCost method.
eth_call
Contract call: FrontendTransfer#validate
From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
To: 0x3155755b79aa083bd953911c92705b7aa82a18f9
Error: Transaction reverted: function call to a non-contract account
at FrontendTransfer.verifySingle (contracts/libs/BLS.sol:65)
at FrontendTransfer.validate (contracts/client/FrontendTransfer.sol:99)
at FrontendTransfer.validate (contracts/client/FrontendTransfer.sol:80)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at EthModule._callAction (/Users/liangcc/projects/EAPL/reddit_optimistic_rollup/contracts/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:317:9)
at HardhatNetworkProvider._sendWithLogging (/Users/liangcc/projects/EAPL/reddit_optimistic_rollup/contracts/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:114:22)
at HardhatNetworkProvider.request (/Users/liangcc/projects/EAPL/reddit_optimistic_rollup/contracts/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:98:16)
at JsonRpcHandler._handleRequest (/Users/liangcc/projects/EAPL/reddit_optimistic_rollup/contracts/node_modules/hardhat/src/internal/hardhat-network/jsonrpc/handler.ts:187:20)
at JsonRpcHandler._handleSingleRequest (/Users/liangcc/projects/EAPL/reddit_optimistic_rollup/contracts/node_modules/hardhat/src/internal/hardhat-network/jsonrpc/handler.ts:166:17)
Possible root cause
View functions raise no exceptions when revert. It's a bug in the jsonrpc level.
What's wrong
The symptom
We have Frontend contracts that provide convenient methods for the client to perform state transitions or signature validation.
The
validate
method of the Frontend contracts for Transfer validates the signature of a Transfer transaction. It depends onverifySingle
method of the BLS library, which depends ongetGasCost
method of theBNPairingPrecompileCostEstimator
.Before the BNPairingPrecompileCostEstimator is deployed, the
frontendTransfer.validate
should fail since theBLS.verifySingle
is falling to get the gasCost estimate from theBNPairingPrecompileCostEstimator.getGasCost
method.But
frontendTransfer.validate
doesn't fail in the typescript call even that the hardhat node reported the error. The result is reproduced in https://github.com/thehubbleproject/hubble-contracts/pull/460/files#diff-65e9827d8828f65c928802491c64307f19c88f9dc8b5cdd258ed11d2d202aff4R28Possible root cause
View functions raise no exceptions when revert. It's a bug in the jsonrpc level.
How do we fix it
Add
return true
at the bottom of the method seems to fix it.The text was updated successfully, but these errors were encountered: