-
Notifications
You must be signed in to change notification settings - Fork 245
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
fix: remove app-layer usage of transport error #363
Conversation
5f686fc
to
4926852
Compare
.ok_or(RpcError::NullResp)? | ||
.header | ||
.base_fee_per_gas | ||
.ok_or(RpcError::UnsupportedFeature("eip1559"))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense
Err(err) | ||
} | ||
} | ||
Err(RpcError::UnsupportedFeature("eip1559")) => self.handle_legacy_tx(tx).await, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could also fail with a
-32601, message: Method not found
rpc error for the fee_history call?
some providers also return -32600, message: Unsupported method:
so perhaps we should be less restrictive here and also check the rpc error response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could assume any error response is also a reason to retry as a legacy
i'm not 100% convinced that retrying as legacy is the correct thing to do here, as forcing legacy could conflict with users who have already put blobs onto their transaction request. We may want to just return errors here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense, so the unsupported feature check is okay because this looks at the base fee value of the header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to write down somewhere that 1559 is somewhat privileged by the library in ways that other tx types and HF features are not. I.e. we generally assume that 1559 is active and proactively attempt to use it in gas estimation even tho we acknowledge that there may be chains that don't support it
Motivation
TransportError should capture
Transport
-layer errors, not application or RPC semantics errors. RPC semantics errors should be captured byRpcError
(note thatTransportErrorKind
instantiates anRpcError<TransportError>
, not aTransportError
). Application errors should be captured by either RpcError (e.g. when the application expects a non-null response) or by an ErrRespSolution
TransportErrorKing::custom_str
MissingReceipt
variant from TransportErrorNullResp
variant toRpcError
PR Checklist