-
Notifications
You must be signed in to change notification settings - Fork 54
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(octane/evmengine): handle engine errors #2469
Conversation
@@ -32,6 +38,11 @@ func makeProcessProposalRouter(app *App) *baseapp.MsgServiceRouter { | |||
// It also updates some external state. | |||
func makeProcessProposalHandler(router *baseapp.MsgServiceRouter, txConfig client.TxConfig) sdk.ProcessProposalHandler { | |||
return func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) { | |||
// Only allow 10s to process a proposal. Reject proposal otherwise. |
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.
good idea
|
||
return resp, nil | ||
return engine.PayloadStatusV1{}, errors.New("nil error and unknown status", "status", resp.Status) |
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.
should this be a [BUG]?
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.
possibly yeah
@@ -129,30 +108,33 @@ func (c engineClient) ForkchoiceUpdatedV3(ctx context.Context, update engine.For | |||
const endpoint = "forkchoice_updated_v3" | |||
defer latency(c.chain, endpoint)() | |||
|
|||
// isStatusOk returns true if the response status is valid. | |||
isStatusOk := func(resp engine.ForkChoiceResponse) bool { |
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'm curious about this code style: why do you prefer wrapping a map with a closure over simply using a map given it's used once in the function?
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.
functions are easy to read and document. Also slightly more concise
if isStatusOk(resp) {
vs
if okStatuses[resp.PayloadStatus.Status] {
This PR is the commit from Omni to handle errors of engineAPI (omni-network/omni#2469). issue: none
Improve EngineAPI error handling:
status:INVALID
AND errors, so swallow errors if known status is returned.issue: #2461