-
Notifications
You must be signed in to change notification settings - Fork 208
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 reindexing token pool created events when creation and active are different steps #1599
base: main
Are you sure you want to change the base?
Conversation
… different steps Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1599 +/- ##
===========================================
- Coverage 100.00% 99.98% -0.02%
===========================================
Files 337 337
Lines 29498 29501 +3
===========================================
Hits 29498 29498
- Misses 0 2 +2
- Partials 0 1 +1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
@@ -92,6 +92,11 @@ func (dh *definitionHandler) handleTokenPoolDefinition(ctx context.Context, stat | |||
} | |||
} | |||
|
|||
if existing.ID.Equals(pool.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.
I'm trying to understand how we got to this point with a duplicate ID. Your description indicates we are processing a TokenPoolCreated
event, so we're coming in via eventManager.TokenPoolCreated()
and then definitionSender.DefineTokenPool()
and then here.
But in eventManager.TokenPoolCreated()
, there is a check for an existing pool. Is that check failing to find the existing pool and allowing it to get down to 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.
Also worth confirming... were you running the latest release (v1.3.2) when you saw this?
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.
Yes, running the latest v1.3.2 release
I have a set of token pools created and the first one I created then activate it to be published.
The indexer restarted indexing events from the chain and saw the TokenPoolCreation event for the created pool and then it extract the pool information from the operation and compares that to the existing pool in DB but you get the error
This is due to this line of code
firefly/internal/definitions/handler_tokenpool.go
Line 96 in 62ee71f
This throws an error which causes the websocket between FF and Token Connector to disconnect and then it reconnect and gets the same message of TokenPoolCreation and the loop just repeated indefinitely...
I think if the IDs are the same we should just ignore the error and log that we received a duplicate event