Skip to content

Commit

Permalink
Merge pull request #5665 from oasisprotocol/kostko/feature/default-sy…
Browse files Browse the repository at this point in the history
…nc-trustperiod

go/consensus: Change default sync trust period to 30 days
  • Loading branch information
kostko authored Apr 29, 2024
2 parents 1c63a93 + 900482e commit 4f35642
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changelog/5665.cfg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/consensus: Change default sync trust period to 30 days
2 changes: 1 addition & 1 deletion go/consensus/cometbft/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func DefaultConfig() Config {
},
StateSync: StateSyncConfig{
Enabled: false,
TrustPeriod: 24 * time.Hour,
TrustPeriod: 30 * 24 * time.Hour,
TrustHeight: 0,
TrustHash: "",
},
Expand Down
2 changes: 1 addition & 1 deletion go/consensus/pricediscovery/pricediscovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (pd *priceDiscovery) GasPrice() (*quantity.Quantity, error) {
pd.mu.RLock()
defer pd.mu.RUnlock()

return pd.finalGasPrice, nil
return pd.finalGasPrice.Clone(), nil
}

// refreshMinGasPrice refreshes minimum gas price reported by the consensus layer.
Expand Down
2 changes: 1 addition & 1 deletion go/oasis-node/cmd/config/migrate/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ func TestConfigMigrationComplex(t *testing.T) {
require.Equal(newConfig.Consensus.Prune.Strategy, "keep_n")
require.Equal(newConfig.Consensus.Prune.NumKept, uint64(86400))
require.Equal(newConfig.Consensus.StateSync.Enabled, false)
require.Equal(newConfig.Consensus.StateSync.TrustPeriod, 24*time.Hour)
require.Equal(newConfig.Consensus.StateSync.TrustPeriod, 30*24*time.Hour)
require.Equal(newConfig.Consensus.StateSync.TrustHeight, uint64(4692334))
require.Equal(newConfig.Consensus.StateSync.TrustHash, "2d9dd35e7254a6c5c87f49d0646ee359f06f460b72278ad3ac17130bd9a7ec19")
require.Equal(newConfig.Storage.Backend, "badger")
Expand Down

0 comments on commit 4f35642

Please sign in to comment.