Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to map Telos error responses to better reponses from the RPC for sendRawTransaction #57

Open
poplexity opened this issue Sep 26, 2024 · 0 comments · May be fixed by #77
Open

Attempt to map Telos error responses to better reponses from the RPC for sendRawTransaction #57

poplexity opened this issue Sep 26, 2024 · 0 comments · May be fixed by #77
Assignees
Labels

Comments

@poplexity
Copy link
Member

poplexity commented Sep 26, 2024

Here:

if trx_response.is_err() {
let err = trx_response.unwrap_err();
error!("Error sending transaction to Telos: {:?}", err);
return Err(EthApiError::EvmCustom("Error sending transaction to Telos".to_string()));
}

Need to consider the possible error types and try to return the proper error type to reth.

For instance, if you send an EIP-2930 type transaction, we reject it with this error in the log:

2024-09-26T18:46:13.872764Z ERROR reth_telos_rpc::eth::telos_client: Error sending transaction to Telos: SERVER(ServerError { error: SendTransactionResponseError { code: 3050003, name: "eosio_assert_message_exception", what: "eosio_assert_message assertion failure", stack: None, details: [SendTransactionResponseErrorDetails { message: "assertion failure with message: Invalid Transaction: Calling from_big_endian with oversized array", file: "cf_system.cpp", line_number: 14, method: "eosio_assert" }, SendTransactionResponseErrorDetails { message: "eosio.evm <= eosio.evm::raw pending console output: ", file: "apply_context.cpp", line_number: 134, method: "exec_one" }] } })

Example with incorrect gas price:

2024-10-03T05:08:40.639077Z ERROR reth_telos_rpc::eth::telos_client: Error sending transaction to Telos: SERVER(ServerError { error: SendTransactionResponseError { code: 3050003, name: "eosio_assert_message_exception", what: "eosio_assert_message assertion failure", stack: None, details: [SendTransactionResponseErrorDetails { message: "assertion failure with message: Transaction gas price 1100000000 is less than the current fixed gas price of 519432999856", file: "cf_system.cpp", line_number: 22, method: "eosio_assert_message" }, SendTransactionResponseErrorDetails { message: "pending console output: ", file: "apply_context.cpp", line_number: 124, method: "exec_one" }] } })

Similarly, if we get the nonce wrong, we can check the error response from Telos and return a more appropriate variant of EthApiError

@poplexity poplexity added the MVP label Oct 13, 2024
@lesa-telos lesa-telos linked a pull request Dec 9, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants