Error: No relayer responded or accepted the transaction out of the 1 queried: Error sending transaction via relayer 0x2bd5ad3f1bd8c96463ea834f110251fd1d5fc560: canRelay check failed with error 11
Our GSN implementation is currently returning the following error from the Open Zeppelin Relayers on Rinkeby and Ropsten. Using a local and relayer on ganache we receive no error. Our contracts have not changed on either test net. Is everything okay with the relayer, can anyone shed anymore info on what this error code means?
Thanks,
Joe
1 Like
Hi @joeandrews
I can reproduce the error on Rinkeby by returning _rejectRelayedCall(0);
from acceptRelayedCall
_rejectRelayedCall
with an error code of zero added to RELAYED_CALL_REJECTED = 11
gives an error of 11
*
* This overload forwards `context` to _preRelayedCall and _postRelayedCall.
*/
function _approveRelayedCall(bytes memory context) internal pure returns (uint256, bytes memory) {
return (RELAYED_CALL_ACCEPTED, context);
}
/**
* @dev Return this in acceptRelayedCall to impede execution of a relayed call. No fees will be charged.
*/
function _rejectRelayedCall(uint256 errorCode) internal pure returns (uint256, bytes memory) {
return (RELAYED_CALL_REJECTED + errorCode, "");
}
/*
* @dev Calculates how much RelayHub will charge a recipient for using `gas` at a `gasPrice`, given a relayer's
* `serviceFee`.
*/
function _computeCharge(uint256 gas, uint256 gasPrice, uint256 serviceFee) internal pure returns (uint256) {
// The fee is expressed as a percentage. E.g. a value of 40 stands for a 40% fee, so the recipient will be
// charged for 1.4 times the spent amount.
I suspect that the logic in the acceptRelayedCall
of your contract is returning _rejectRelayedCall(0);
.
An example of this is in GSNRecipientERC20Fee
when the token balance isn’t sufficient to cover the charges:
uint256,
uint256,
bytes calldata,
uint256 maxPossibleCharge
)
external
view
returns (uint256, bytes memory)
{
if (_token.balanceOf(from) < maxPossibleCharge) {
return _rejectRelayedCall(uint256(GSNRecipientERC20FeeErrorCodes.INSUFFICIENT_BALANCE));
}
return _approveRelayedCall(abi.encode(from, maxPossibleCharge, transactionFee, gasPrice));
}
/**
* @dev Implements the precharge to the user. The maximum possible charge (depending on gas limit, gas price, and
* fee) will be deducted from the user balance of gas payment token. Note that this is an overestimation of the
* actual charge, necessary because we cannot predict how much gas the execution will actually need. The remainder
* is returned to the user in {_postRelayedCall}.
I suggest checking the logic in the contracts acceptRelayedCall
function.
Feel free to share the contract if you can.
Thank you very much that was it. Everything is fixed now.
1 Like
Hi @joeandrews ,
If you have a moment it would be great to introduce yourself or share what you are working on with the community.