Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- docs: fix dead link in documentation ([#13437](https://github.com/filecoin-project/lotus/pull/13437))
- feat(cli): implement FRC-0102 signing envelope for wallet sign/verify ([filecoin-project/lotus#13471](https://github.com/filecoin-project/lotus/pull/13471))
- feat(cli): add --order-by-nonce flag to list messages sequentially when filtering by sender ([filecoin-project/lotus#13394](https://github.com/filecoin-project/lotus/pull/13394))
- fix(eth): use error code 3 for EExecutionReverted for Ethereum RPC tooling compatibility ([filecoin-project/lotus#13467](https://github.com/filecoin-project/lotus/pull/13467))
- BREAKING: RPC error codes changed - EActorNotFound (3→11), EExecutionReverted (11→3). Mismatched client/server versions will deserialize these errors as the wrong Go type, breaking errors.Is/As checks.

# Node v1.34.3 / 2025-12-03

Expand Down
4 changes: 2 additions & 2 deletions api/api_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ var invalidExecutionRevertedMsg = xerrors.New("invalid execution reverted error"

const (
EOutOfGas = iota + jsonrpc.FirstUserCode
EActorNotFound
EExecutionReverted
EF3Disabled
EF3ParticipationTicketInvalid
EF3ParticipationTicketExpired
EF3ParticipationIssuerMismatch
EF3ParticipationTooManyInstances
EF3ParticipationTicketStartBeforeExisting
EF3NotReady
EExecutionReverted
EActorNotFound
ENullRound
EPaymentChannelDisabled
)
Expand Down
28 changes: 28 additions & 0 deletions itests/fevm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,34 @@ func TestFEVMErrorParsing(t *testing.T) {
})
})
}

// Verify that the raw JSON-RPC error code is 3, per Ethereum standard for execution reverted.
// See: https://github.com/ethereum/go-ethereum/pull/21083 (geth v1.9.15)
t.Run("RawErrorCode3", func(t *testing.T) {
entryPoint := kit.CalcFuncSignature("failRevertReason()")

request := fmt.Sprintf(`{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_call",
"params": [{"to": "%s", "data": "0x%x"}, "latest"]
}`, contractAddrEth.String(), entryPoint)

statusCode, responseBody := client.DoRawRPCRequest(t, 1, request)
require.Equal(t, 200, statusCode)

var rpcResponse struct {
Error struct {
Code int `json:"code"`
Message string `json:"message"`
Data string `json:"data"`
} `json:"error"`
}
require.NoError(t, json.Unmarshal(responseBody, &rpcResponse))
require.Equal(t, 3, rpcResponse.Error.Code,
"execution reverted error code must be 3 for Ethereum RPC compatibility (EIP-1474 de facto standard)")
require.NotEmpty(t, rpcResponse.Error.Data, "error response should include revert data")
})
}

// TestEthGetBlockReceipts tests retrieving block receipts after invoking a contract
Expand Down