-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat(hardfork): l2 hardfork #1212
Conversation
block/modes.go
Outdated
|
||
func (m *Manager) subscribeFullNodeEvents(ctx context.Context) { | ||
// Subscribe to new (or finalized) state updates events. | ||
go uevent.MustSubscribe(ctx, m.Pubsub, syncLoop, settlement.EventQueryNewSettlementBatchAccepted, m.onNewStateUpdate, m.logger) |
Check notice
Code scanning / CodeQL
Spawning a Go routine
block/modes.go
Outdated
func (m *Manager) subscribeFullNodeEvents(ctx context.Context) { | ||
// Subscribe to new (or finalized) state updates events. | ||
go uevent.MustSubscribe(ctx, m.Pubsub, syncLoop, settlement.EventQueryNewSettlementBatchAccepted, m.onNewStateUpdate, m.logger) | ||
go uevent.MustSubscribe(ctx, m.Pubsub, validateLoop, settlement.EventQueryNewSettlementBatchFinalized, m.onNewStateUpdateFinalized, m.logger) |
Check notice
Code scanning / CodeQL
Spawning a Go routine
go uevent.MustSubscribe(ctx, m.Pubsub, validateLoop, settlement.EventQueryNewSettlementBatchFinalized, m.onNewStateUpdateFinalized, m.logger) | ||
|
||
// Subscribe to P2P received blocks events (used for P2P syncing). | ||
go uevent.MustSubscribe(ctx, m.Pubsub, p2pGossipLoop, p2p.EventQueryNewGossipedBlock, m.OnReceivedBlock, m.logger) |
Check notice
Code scanning / CodeQL
Spawning a Go routine
|
||
// Subscribe to P2P received blocks events (used for P2P syncing). | ||
go uevent.MustSubscribe(ctx, m.Pubsub, p2pGossipLoop, p2p.EventQueryNewGossipedBlock, m.OnReceivedBlock, m.logger) | ||
go uevent.MustSubscribe(ctx, m.Pubsub, p2pBlocksyncLoop, p2p.EventQueryNewBlockSyncBlock, m.OnReceivedBlock, m.logger) |
Check notice
Code scanning / CodeQL
Spawning a Go routine
68644a8
to
217ba07
Compare
635d160
to
f815898
Compare
047c201
to
5f0f8d1
Compare
block/retriever.go
Outdated
if err != nil { | ||
return err | ||
} | ||
if m.shouldStopNode(rollapp, m.State.GetRevision()) { |
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.
not sure why we check it inside the loop.
a batch has single revision
this can be checked at the start
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.
because revision is not serialized in the batch, therefore it needs to be obtained from the block in retrieval
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.
so it should be added in convertStateInfoToResultRetrieveBatch
block/retriever.go
Outdated
rollapp, err := m.SLClient.GetRollapp() | ||
if err != nil { | ||
return err | ||
} | ||
if m.shouldStopNode(rollapp, m.State.GetRevision()) { | ||
err = m.createInstruction(rollapp) | ||
if err != nil { | ||
return err | ||
} | ||
m.freezeNode(context.Background(), fmt.Errorf("syncing to fork height. please restart the node. local_block_height: %d rollapp_revision_start_height: %d local_revision: %d rollapp_revision: %d", m.State.Height(), rollapp.RevisionStartHeight, m.State.GetRevision(), rollapp.Revision)) | ||
return 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.
same snippet as m.checkForkUpdate()
rollapp, err := m.SLClient.GetRollapp() | |
if err != nil { | |
return err | |
} | |
if m.shouldStopNode(rollapp, m.State.GetRevision()) { | |
err = m.createInstruction(rollapp) | |
if err != nil { | |
return err | |
} | |
m.freezeNode(context.Background(), fmt.Errorf("syncing to fork height. please restart the node. local_block_height: %d rollapp_revision_start_height: %d local_revision: %d rollapp_revision: %d", m.State.Height(), rollapp.RevisionStartHeight, m.State.GetRevision(), rollapp.Revision)) | |
return nil | |
} | |
m.checkForkUpdate() |
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.
replaced by checkForkUpdate, adding stop message in the func.
Co-authored-by: Sergi Rene <[email protected]>
PR Standards
Opening a pull request should be able to meet the following requirements
--
PR naming convention: https://hackmd.io/@nZpxHZ0CT7O5ngTp0TP9mg/HJP_jrm7A
Close #XXX
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: