-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Improve substreams error handling #5160
Conversation
e12696c
to
0441af0
Compare
graph/src/blockchain/block_stream.rs
Outdated
@@ -408,6 +409,10 @@ pub trait BlockStreamMapper<C: Blockchain>: Send + Sync { | |||
None => return Err(SubstreamsError::MissingClockError), | |||
}; | |||
|
|||
if clock.number > 11808300 { | |||
panic!("end block") |
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.
What is the panic 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.
great catch, this was leftover from rebase I think
); | ||
return; | ||
} | ||
_ => unreachable!(), |
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.
Why is BlockStreamError::Unknown
not handled? would only Fatal errors be returned at this point?
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.
at the moment, only deterministic errors get returned, maybe I'll add some more information to this, thanks for pointing it out
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 had left a comment on process_blocks but I will add something here as well
@@ -748,10 +748,7 @@ fn insert_subgraph_error(conn: &PgConnection, error: &SubgraphError) -> anyhow:: | |||
} = error; | |||
|
|||
let block_num = match &block_ptr { | |||
None => { | |||
assert_eq!(*deterministic, false); |
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.
Why was this assertion removed?
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.
This was discussed with the team, as far as I can understand this was a sanity check that determisnistic errors could only happen with a block number being set, this is not longer the case with substreams, since the deterministic error can even happen at boot time, for example, with incorrect number of arguments.
0441af0
to
56fed4b
Compare
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.
LGTM
Code::InvalidArgument
is returned as the grpc status codeOption<String>
withFirehoseCursor
.