Skip to content

Commit

Permalink
fix(manager): fixed getting proposer to get for next height and not c…
Browse files Browse the repository at this point in the history
…urrent one (#1202)
  • Loading branch information
omritoptix authored Nov 6, 2024
1 parent 81c2d3d commit 3c0b798
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (m *Manager) Start(ctx context.Context) error {
// In case there is also no proposer on the hub to our current height, it means that the chain is halted.
if m.State.GetProposer() == nil {
m.logger.Info("No proposer on the rollapp, fallback to the hub proposer, if available")
SLProposer, err := m.SLClient.GetProposerAtHeight(int64(m.State.Height()))
SLProposer, err := m.SLClient.GetProposerAtHeight(int64(m.State.NextHeight()))
if err != nil {
return fmt.Errorf("get proposer at height: %w", err)
}
Expand Down
10 changes: 5 additions & 5 deletions settlement/dymension/dymension.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
)

const (
addressPrefix = "dym"
UNAVAILABLE_PROPOSER = ""
addressPrefix = "dym"
SENTINEL_PROPOSER = ""
)

const (
Expand Down Expand Up @@ -346,8 +346,8 @@ func (c *Client) GetProposerAtHeight(height int64) (*types.Sequencer, error) {
}
}

if proposerAddr == "" {
return nil, fmt.Errorf("proposer address is empty")
if proposerAddr == SENTINEL_PROPOSER {
return nil, fmt.Errorf("proposer is sentinel")
}

// Find and return the matching sequencer
Expand Down Expand Up @@ -538,7 +538,7 @@ func (c *Client) GetNextProposer() (*types.Sequencer, error) {
if !found {
return nil, nil
}
if nextAddr == UNAVAILABLE_PROPOSER {
if nextAddr == SENTINEL_PROPOSER {
return &types.Sequencer{}, nil
}

Expand Down

0 comments on commit 3c0b798

Please sign in to comment.