Skip to content

Commit

Permalink
clear drsversion fork
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Nov 11, 2024
1 parent 2ded44f commit f815898
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,24 @@ func NewManager(
return nil, err
}

if instruction, forkNeeded := m.forkNeeded(); forkNeeded {
// Set proposer to nil
m.State.SetProposer(nil)

// Upgrade revision on state
state := m.State
state.Version.Consensus.App = instruction.Revision
state.VersionStartHeight = instruction.RevisionStartHeight
if instruction.RevisionStartHeight == m.State.Height() {
drsVersion, err := strconv.ParseUint(version.DrsVersion, 10, 32)
if err != nil {
return nil, fmt.Errorf("unable to parse drs version")
}
state.RollappParams.DrsVersion = uint32(drsVersion)
}
m.State = state
}

// validate configuration params and rollapp consensus params are in line
err = m.ValidateConfigWithRollappParams()
if err != nil {
Expand All @@ -211,17 +229,6 @@ func (m *Manager) Start(ctx context.Context) error {
}
}

if instruction, forkNeeded := m.forkNeeded(); forkNeeded {
// Set proposer to nil
m.State.SetProposer(nil)

// Upgrade revision on state
state := m.State
state.Version.Consensus.App = instruction.Revision
state.VersionStartHeight = instruction.RevisionStartHeight
m.State = state
}

// Check if a proposer on the rollapp is set. In case no proposer is set on the Rollapp, fallback to the hub proposer (If such exists).
// No proposer on the rollapp means that at some point there was no available proposer.
// In case there is also no proposer on the hub to our current height, it means that the chain is halted.
Expand Down

0 comments on commit f815898

Please sign in to comment.