-
Notifications
You must be signed in to change notification settings - Fork 43
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
[NONEVM-916] logpoller log processing & decoding #1002
base: develop
Are you sure you want to change the base?
Conversation
c208014
to
e49250f
Compare
e49250f
to
580d1af
Compare
Also: keep retrying if LogCollector fails to start
a77bf76
to
ec90e37
Compare
|
||
const DiscriminatorLength = 8 | ||
|
||
func Discriminator(namespace, name string) [DiscriminatorLength]byte { |
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.
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.
Yeah, that PR will go in after this one... this will use his discriminator once that gets merged.
fl.loadedFilters.Store(true) | ||
|
||
return nil | ||
} | ||
|
||
func (fl *filters) DecodeSubKey(ctx context.Context, raw []byte, ID int64, subKeyPath []string) (any, error) { | ||
filter, ok := fl.filtersByID[ID] |
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.
nit: we might want to mark this method as unsafe to signal that it should only be called from locked context of matching filters
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.
Oh yeah, I should add that to this as well as IncrementSeqNums
pkg/solana/logpoller/filters.go
Outdated
// this will be called on every new event that happens on the blockchain, so it's important it returns immediately if it | ||
// doesn't match any registered filters. | ||
func (fl *filters) MatchingFiltersForEncodedEvent(event ProgramEvent) iter.Seq[Filter] { | ||
if _, ok := fl.knownPrograms[event.Program]; !ok { |
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.
concurrent read & write to the map leads to panic
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 catch!
// Value implements valuer for database/sql. | ||
func (s EventSignature) Value() (driver.Value, error) { | ||
return s[:], nil | ||
func NewIndexedValue(typedVal any) (iVal IndexedValue, err error) { |
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.
Nice work! I thought we'd have to build something super complex to support <
>
operators.
Also: add warnings to methods which are not intended to be called concurrently
Quality Gate failedFailed conditions |
JIRA: LINK-916
This adds the implementation of
lp.Process()
, and also initializes LogPoller with a client that gets passed along to initialize the EncodedLogCollector.In order, the main 3 tasks performed by
lp.Process
are: