Skip to content

Commit

Permalink
cleans up the code
Browse files Browse the repository at this point in the history
  • Loading branch information
staheri14 committed Oct 11, 2024
1 parent 122058b commit f74d19b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 22 deletions.
14 changes: 3 additions & 11 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -870,17 +870,11 @@ func NewNodeWithContext(ctx context.Context,
if err != nil {
return nil, fmt.Errorf("error during info call: %w", err)
}
softwareVersion = resp.Version // TODO is this the same as celestia-app version
softwareVersion = resp.Version
}

//resp, err := proxyApp.Query().InfoSync(proxy.RequestInfo)
//if err != nil {
// return nil, fmt.Errorf("error during info call: %w", err)
//}

// Determine whether we should do fast sync. This must happen after the handshake, since the
// app may modify the validator set,
//specifying ourselves as the only validator.
// app may modify the validator set, specifying ourselves as the only validator.
fastSync := config.FastSyncMode && !onlyValidatorIsUs(state,
pubKey) // the state certainly has the latest timeouts according
// the app version lastBlock in the blockstore
Expand Down Expand Up @@ -939,9 +933,7 @@ func NewNodeWithContext(ctx context.Context,
privValidator, csMetrics, stateSync || fastSync, eventBus, consensusLogger, tracer,
)

logger.Info("Consensus reactor created", "timeout_propose",
consensusState.GetState().TimeoutPropose, "timeout_commit",
consensusState.GetState().TimeoutCommit)
logger.Info("Consensus reactor created", "timeout_propose", consensusState.GetState().TimeoutPropose, "timeout_commit", consensusState.GetState().TimeoutCommit)
// Set up state sync reactor, and schedule a sync if requested.
// FIXME The way we do phased startups (e.g. replay -> fast sync -> consensus) is very messy,
// we should clean this whole thing up. See:
Expand Down
5 changes: 2 additions & 3 deletions rpc/core/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ func ConsensusState(ctx *rpctypes.Context) (*ctypes.ResultConsensusState, error)
return &ctypes.ResultConsensusState{RoundState: bz}, err
}

func ConsensusTimeoutsInfo(ctx *rpctypes.Context,
heightPtr int64) (*abci.TimeoutsInfo, error) {
return GetEnvironment().StateStore.LoadConsensusTimeoutsInfo(heightPtr)
func ConsensusTimeoutsInfo(ctx *rpctypes.Context, height int64) (*abci.TimeoutsInfo, error) {
return GetEnvironment().StateStore.LoadConsensusTimeoutsInfo(height)
}

// ConsensusParams gets the consensus parameters at the given block height.
Expand Down
7 changes: 0 additions & 7 deletions state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ type State struct {
TimeoutCommit time.Duration
}

func (state *State) GetTimeoutPropose() time.Duration {
return state.TimeoutPropose
}
func (state *State) GetTimeoutCommit() time.Duration {
return state.TimeoutCommit
}

// Copy makes a copy of the State for mutating.
func (state State) Copy() State {
return State{
Expand Down
1 change: 0 additions & 1 deletion state/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ func (store dbStore) save(state State, key []byte) error {
}

// save next timeouts
// TODO write test for this
if err := store.saveConsensusTimeoutsInfo(nextHeight, &abci.TimeoutsInfo{TimeoutPropose: state.TimeoutPropose, TimeoutCommit: state.TimeoutCommit}); err != nil {
return err
}
Expand Down

0 comments on commit f74d19b

Please sign in to comment.