-
Notifications
You must be signed in to change notification settings - Fork 44
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
Lazy-start LogPoller from ContractReader, stop if started on shutdown #1051
base: develop
Are you sure you want to change the base?
Conversation
51ee0cb
to
ff0e81f
Compare
ead0465
to
6ca9812
Compare
@@ -547,6 +548,9 @@ func (c *chain) Close() error { | |||
c.lggr.Debug("Stopping multinode") | |||
closeAll = append(closeAll, c.multiNode, c.txSender) | |||
} | |||
if c.lp.Ready() == nil { |
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 happens in ready throws an error
|
// No dependency on EventReader | ||
return nil | ||
} | ||
if s.reader.Ready() != nil { |
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 seems to be racy. Ready returns an error if the reader is starting.
In case of LogPoller, it's easy to decide if it needs to do work or not. Can't we always start and check if there are any filters inside the run loop?
@@ -457,7 +470,7 @@ func toLPFilter( | |||
Address: logpoller.PublicKey(address), | |||
EventName: f.EventName, | |||
EventSig: logpoller.EventSignature([]byte(f.EventName)[:logpoller.EventSignatureLength]), |
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.
EventSig: logpoller.EventSignature([]byte(f.EventName)[:logpoller.EventSignatureLength]), | |
EventSig: logpoller.EventSignature([]byte(f.EventName)[:logpoller.EventSignatureLength]), | |
EventSig: logpoller.NewEventSignatureFromName(f.EventName), |
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.
Also eventIDL is not set. Seems like we need our own e2e tests as soon as possible.
Description
JIRA: NONEVM-1286