Skip to content

Commit

Permalink
chore: update core and coreutils
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Dec 13, 2024
1 parent 9e34404 commit 493d623
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cmd/hostd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func runRootCmd(ctx context.Context, cfg config.Config, walletKey types.PrivateK
go rhp3.Serve()
defer rhp3.Close()

rhp4 := rhp4.NewServer(hostKey, cm, s, contractManager, wm, sm, vm, rhp4.WithPriceTableValidity(30*time.Minute), rhp4.WithContractProofWindowBuffer(72))
rhp4 := rhp4.NewServer(hostKey, cm, s, contractManager, wm, sm, vm, rhp4.WithPriceTableValidity(30*time.Minute))

var stopListenerFuncs []func() error
defer func() {
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/mattn/go-sqlite3 v1.14.24
github.com/shopspring/decimal v1.4.0
go.sia.tech/core v0.7.1
go.sia.tech/coreutils v0.7.1-0.20241203172514-7bf95dd18f31
go.sia.tech/core v0.8.0
go.sia.tech/coreutils v0.8.0
go.sia.tech/jape v0.12.1
go.sia.tech/mux v1.3.0
go.sia.tech/web/hostd v0.52.0
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.0
Expand All @@ -33,12 +34,11 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
go.etcd.io/bbolt v1.3.11 // indirect
go.sia.tech/mux v1.3.0 // indirect
go.sia.tech/web v0.0.0-20240610131903-5611d44a533e // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.22.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
go.sia.tech/core v0.7.1 h1:PrKh19Ql5vJbQbB5YGtTHQ8W3fRF8hhYnR4kPOIOIME=
go.sia.tech/core v0.7.1/go.mod h1:gB8iXFJFSV8XIHRaL00CL6Be+hyykB+SYnvRPHCCc/E=
go.sia.tech/coreutils v0.7.1-0.20241203172514-7bf95dd18f31 h1:Qskaf8d6oDKG5emNvGHZsd9iZRqz2GeouVNKY5paXlE=
go.sia.tech/coreutils v0.7.1-0.20241203172514-7bf95dd18f31/go.mod h1:d6jrawloc02MCXi/EVc8FIN5h3C6XDiMs4fuFMcU0PU=
go.sia.tech/core v0.8.0 h1:J6vZQlVhpj4bTVeuC2GKkfkGEs8jf0j651Kl1wwOxjg=
go.sia.tech/core v0.8.0/go.mod h1:Wj1qzvpMM2rqEQjwWJEbCBbe9VWX/mSJUu2Y2ABl1QA=
go.sia.tech/coreutils v0.8.0 h1:1dcl0vxY+MBgAdJ7PdewAr8RkZJn4/6wAKEZfi4iYn0=
go.sia.tech/coreutils v0.8.0/go.mod h1:ml5MefDMWCvPKNeRVIGHmyF5tv27C9h1PiI/iOiTGLg=
go.sia.tech/jape v0.12.1 h1:xr+o9V8FO8ScRqbSaqYf9bjj1UJ2eipZuNcI1nYousU=
go.sia.tech/jape v0.12.1/go.mod h1:wU+h6Wh5olDjkPXjF0tbZ1GDgoZ6VTi4naFw91yyWC4=
go.sia.tech/mux v1.3.0 h1:hgR34IEkqvfBKUJkAzGi31OADeW2y7D6Bmy/Jcbop9c=
Expand All @@ -58,20 +58,20 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
Expand Down
12 changes: 10 additions & 2 deletions host/contracts/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,17 @@ func (cm *Manager) LockV2Contract(id types.FileContractID) (rev rhp4.RevisionSta
return rhp4.RevisionState{}, nil, fmt.Errorf("failed to get contract: %w", err)
}

renewed := contract.RenewedTo != (types.FileContractID{})
var maxRevisionHeight uint64
if contract.ProofHeight > cm.revisionSubmissionBuffer {
maxRevisionHeight = contract.ProofHeight - cm.revisionSubmissionBuffer
}
revisable := !renewed && cm.chain.Tip().Height < maxRevisionHeight
return rhp4.RevisionState{
Revision: contract.V2FileContract,
Roots: cm.getSectorRoots(id),
Revision: contract.V2FileContract,
Renewed: contract.RenewedTo != (types.FileContractID{}),
Revisable: revisable,
Roots: cm.getSectorRoots(id),
}, func() {
cm.locks.Unlock(id)
}, nil
Expand Down
12 changes: 6 additions & 6 deletions internal/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func V2Network() (*consensus.Network, types.Block) {
}

// WaitForSync is a helper to wait for the chain and indexer to sync
func WaitForSync(t *testing.T, cm *chain.Manager, idx *index.Manager) {
func WaitForSync(t testing.TB, cm *chain.Manager, idx *index.Manager) {
t.Helper()

for {
Expand All @@ -74,7 +74,7 @@ func WaitForSync(t *testing.T, cm *chain.Manager, idx *index.Manager) {
}

// MineBlocks is a helper to mine blocks and broadcast the headers
func MineBlocks(t *testing.T, cn *ConsensusNode, addr types.Address, n int) {
func MineBlocks(t testing.TB, cn *ConsensusNode, addr types.Address, n int) {
t.Helper()

for i := 0; i < n; i++ {
Expand All @@ -95,7 +95,7 @@ func MineBlocks(t *testing.T, cn *ConsensusNode, addr types.Address, n int) {

// MineAndSync is a helper to mine blocks and wait for the index to catch up
// between each block
func MineAndSync(t *testing.T, hn *HostNode, addr types.Address, n int) {
func MineAndSync(t testing.TB, hn *HostNode, addr types.Address, n int) {
t.Helper()

for i := 0; i < n; i++ {
Expand All @@ -106,7 +106,7 @@ func MineAndSync(t *testing.T, hn *HostNode, addr types.Address, n int) {

// NewConsensusNode initializes all of the consensus components and returns them.
// The function will clean up all resources when the test is done.
func NewConsensusNode(t *testing.T, network *consensus.Network, genesis types.Block, log *zap.Logger) *ConsensusNode {
func NewConsensusNode(t testing.TB, network *consensus.Network, genesis types.Block, log *zap.Logger) *ConsensusNode {
t.Helper()

dir := t.TempDir()
Expand Down Expand Up @@ -156,7 +156,7 @@ func NewConsensusNode(t *testing.T, network *consensus.Network, genesis types.Bl

// NewHostNode initializes all of the hostd components and returns them. The function
// will clean up all resources when the test is done.
func NewHostNode(t *testing.T, pk types.PrivateKey, network *consensus.Network, genesis types.Block, log *zap.Logger) *HostNode {
func NewHostNode(t testing.TB, pk types.PrivateKey, network *consensus.Network, genesis types.Block, log *zap.Logger) *HostNode {
t.Helper()

cn := NewConsensusNode(t, network, genesis, log)
Expand All @@ -181,7 +181,7 @@ func NewHostNode(t *testing.T, pk types.PrivateKey, network *consensus.Network,

initialSettings := settings.DefaultSettings
initialSettings.AcceptingContracts = true
initialSettings.NetAddress = "127.0.0.1:9981"
initialSettings.NetAddress = "127.0.0.1"
initialSettings.WindowSize = 10
sm, err := settings.NewConfigManager(pk, cn.Store, cn.Chain, cn.Syncer, vm, wm, settings.WithAnnounceInterval(10), settings.WithValidateNetAddress(false), settings.WithInitialSettings(initialSettings))
if err != nil {
Expand Down

0 comments on commit 493d623

Please sign in to comment.