13 Commits

Author SHA1 Message Date
Rod Vagg
bb09f458cb fix(eth)!: use error code 3 for EExecutionReverted (#13467)
BREAKING: RPC error codes changed - EActorNotFound (from 3 to 11),
EExecutionReverted (from 11 to 3). Mismatched client/server versions will
deserialize these errors as the wrong Go type, breaking errors.Is/As
checks.

Swap EExecutionReverted and EActorNotFound positions so that
EExecutionReverted gets code 3, the de facto Ethereum standard for
execution reverted errors. This enables proper error decoding by
Ethereum tooling like viem, ethers.js, and other RPC clients.

Error code 3 was introduced in geth v1.9.15 and is now expected by
most Ethereum ecosystem tooling for automatic ABI decoding of revert
reasons from the error data field.

Ref: https://github.com/ethereum/go-ethereum/pull/21083
Ref: https://github.com/ethereum/go-ethereum/pull/31456
Ref: https://github.com/ethereum/go-ethereum/issues/21886
Ref: 6c11882938/src/utils/errors/getContractError.ts
Ref: https://www.quicknode.com/docs/ethereum/error-references
Ref: https://docs.metamask.io/services/reference/ethereum/json-rpc-methods/eth_call/
2026-01-28 09:54:42 -08:00
Rod Vagg
d562c52256 fix(err): don't present non-ethereum error as an ethereum-style (#13406) 2025-10-27 23:45:20 +13:00
wyrapeseed
03300fa91c chore: fix typo in comment (#13402)
Signed-off-by: wyrapeseed <wyrapeseed@outlook.com>
2025-10-21 21:41:01 +13:00
Rod Vagg
cbed4c2bac fix(eth): properly return vm error in all gas estimation methods (#13389) 2025-10-15 18:09:24 +13:00
Phi-rjan
9f34758699 fix(cli): improve error handling for disabled payment channels (#13350) 2025-10-06 06:32:43 +02:00
Rod Vagg
e9393dfe8c fix(eth): present revert "data" as plain bytes
decode the cbor return value for reverts and present that, as is expected by
Ethereum tooling
2024-11-07 16:29:22 +11:00
Viraj Bhartiya
6a70c6b01b feat(eth): return consistent error for null rounds from RPC methods (#12655) 2024-10-31 20:12:34 +11:00
Viraj Bhartiya
082b7caab5 feat(api): populate data field for revert error in EthEstimateGas and EthCall (#12553)
Co-authored-by: Aryan Tikarya <aryan.tikarya@dojima.network>
2024-10-25 01:13:32 +00:00
Masih H. Derkani
e04dbe1733 Fix F3 JSON RPC error pass through across API boundary (#12637)
Fix the issue by instantiating pointers to sentinel F3 error values and
assert that errors indeed pass through via an integration test.

Fixes #12630
2024-10-24 15:47:44 +00:00
Masih H. Derkani
a0d529263a feat: implement ticket based F3 participation lease (#12531)
* Implement ticket based F3 participation lease

Implemented enhanced ticket-based participation system for F3 consensus
in `F3Participate`. This update introduces a new design where
participation tickets grant a temporary lease, allowing storage
providers to sign as part of the F3 consensus mechanism. This design ensures that
tickets are checked for validity and issuer alignment, handling errors
robustly. If there's an issuer mismatch, the system advises miners to
retry with the existing ticket. If the ticket is invalid or expired,
miners are directed to obtain a new ticket via
`F3GetOrRenewParticipationTicket`.

Fixes https://github.com/filecoin-project/go-f3/issues/599

* Use fresh timer every time for F3 backoffs

To avoid potential of deadlock in case f3Participator is used from
multiple goroutines use throw-away timers at the price of higher GC.

Also use the cancel function in context explicitly in a unified stop
hook that awaits the participation to end before exiting.

* Strictly require start instance to never decrease

Require the start instance of a participation to never decrease if there
 is an existing lease by the miner.

* feat(f3): update go-f3 to 0.7.0 and adapt for changes to the API

* feat(f3): Include the network name in the lease

That way we don't re-use leases across networks. It's a bit racy (we ask
for the manifest before we ask for the current progress) but it should
be fine because at least we won't create a lease for the new network
with a future instance.

There's still an ABA problem if we rapidly switch back and forth between
two networks but... let's just not do that? At least for the mainnet
switchover, that won't be an issue because we enforce a 900 epoch
silence period.

I have to say, I'm not happy about this. But... we can probably just
hard-code it in the future once we get rid of the dynamic manifest.

* Handle not ready error gracefully in participator

Back off and get a fresh token if F3 is not ready.

---------

Co-authored-by: Steven Allen <steven@stebalien.com>
2024-10-08 09:57:23 +01:00
Aayush
13f3e0aca4 fix: itest: check for closed connection 2022-09-27 15:34:01 +00:00
Aayush
5d28eea968 chore: deps: update to go-jsonrpc 0.1.8 2022-09-27 15:34:01 +00:00
Aayush
27880ece2b feat: support typed errors over RPC 2022-09-27 15:34:01 +00:00