-
Notifications
You must be signed in to change notification settings - Fork 82
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(manager): allow starting node when sequencer is sentinel #1275
Conversation
block/manager.go
Outdated
@@ -232,7 +232,9 @@ func (m *Manager) Start(ctx context.Context) error { | |||
if m.State.GetProposer() == nil { | |||
m.logger.Info("No proposer on the rollapp, fallback to the hub proposer, if available") | |||
err := m.UpdateProposerFromSL() | |||
if err != nil { | |||
if errors.Is(err, settlement.ErrProposerIsSentinel) { | |||
m.freezeNode(fmt.Errorf("unable to start without new proposer at height %d", m.State.NextHeight())) |
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 u need it here? if u allow starting as full node anyway?
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 added to freeze node instead of panicing when sentinel. however, i replaced it by a waiting function, so in case no active proposer is found it will wait til there is an active proposer, without requirng to restart.
block/manager.go
Outdated
@@ -246,7 +248,9 @@ func (m *Manager) Start(ctx context.Context) error { | |||
// for this case, 2 nodes will get `true` for `AmIProposer` so the l2 proposer can produce blocks and the hub proposer can submit his last batch. | |||
// The hub proposer, after sending the last state update, will panic and restart as full node. | |||
amIProposerOnSL, err := m.AmIProposerOnSL() |
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.
u can add
if errors.Is(err, settlement.ErrProposerIsSentinel) {
return false, nil
into m.AmIProposerOnSL()
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.
moved
@@ -347,8 +347,8 @@ func (c *Client) GetProposerAtHeight(height int64) (*types.Sequencer, error) { | |||
} | |||
} | |||
|
|||
if proposerAddr == SENTINEL_PROPOSER { | |||
return nil, fmt.Errorf("proposer is sentinel") | |||
if proposerAddr == "" || proposerAddr == SENTINEL_PROPOSER { |
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.
when does == "" happens?
PR Standards
Opening a pull request should be able to meet the following requirements
--
PR naming convention: https://hackmd.io/@nZpxHZ0CT7O5ngTp0TP9mg/HJP_jrm7A
Close #1273,#1274
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: