Skip to content

Commit

Permalink
remove minMana from protocol parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberphysic4l committed Oct 3, 2023
1 parent baba034 commit cd61f77
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388
github.com/labstack/echo/v4 v4.11.1
github.com/labstack/gommon v0.4.0
github.com/libp2p/go-libp2p v0.30.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e h1:Mwoe7
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e/go.mod h1:jhzexR5X8m6qcmrwt5OX477O/ZwT7Ak9sPT83ByPkAo=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951 h1:qUf1W0fE1IyZzVy3Exv0Kj+SKECXG3S26c9m2ETb07U=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951/go.mod h1:c5778OnWpLq108YE+Eb2m8Ri/t/4ydV0TvI/Sy5YivQ=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297 h1:kbpsa/gF0x6Cxu5lN9TL8u5EdaGv1P3/OKKPW0w83Og=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388 h1:IGqHrJRmrzfalf1py+FGWzkWoaA5o6avBSYWznVG08s=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/ipfs/boxo v0.10.0 h1:tdDAxq8jrsbRkYoF+5Rcqyeb91hgWe2hp7iLu7ORZLY=
github.com/ipfs/boxo v0.10.0/go.mod h1:Fg+BnfxZ0RPzR0nOodzdIq3A7KgoWAOWsEIImrIQdBM=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,9 @@ func NewProvider(opts ...options.Option[Scheduler]) module.Provider[*engine.Engi
return 0, err
}

minMana := s.apiProvider.CurrentAPI().ProtocolParameters().CongestionControlParameters().MinMana
if mana < minMana {
return 0, ierrors.Errorf("account %s has insufficient Mana for block to be scheduled: account Mana %d, min Mana %d", accountID, mana, minMana)
}

mana = lo.Min(mana, iotago.Mana(s.maxDeficit()-1))

return 1 + Deficit(mana/minMana), nil
return 1 + Deficit(mana), nil
}
})
s.TriggerConstructed()
Expand Down
3 changes: 0 additions & 3 deletions pkg/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ type TestSuite struct {
optsRMCIncreaseThreshold iotago.WorkScore
optsRMCDecreaseThreshold iotago.WorkScore
optsSchedulerRate iotago.WorkScore
optsMinMana iotago.Mana
optsMaxBufferSize uint32
optsAccounts []snapshotcreator.AccountDetails
optsSnapshotOptions []options.Option[snapshotcreator.Options]
Expand Down Expand Up @@ -98,7 +97,6 @@ func NewTestSuite(testingT *testing.T, opts ...options.Option[TestSuite]) *TestS
optsRMCIncreaseThreshold: 8 * schedulerRate,
optsRMCDecreaseThreshold: 5 * schedulerRate,
optsSchedulerRate: schedulerRate,
optsMinMana: 1,
optsMaxBufferSize: 100 * iotago.MaxBlockSize,
}, opts, func(t *TestSuite) {
fmt.Println("Setup TestSuite -", testingT.Name(), " @ ", time.Now())
Expand Down Expand Up @@ -136,7 +134,6 @@ func NewTestSuite(testingT *testing.T, opts ...options.Option[TestSuite]) *TestS
t.optsRMCIncreaseThreshold,
t.optsRMCDecreaseThreshold,
t.optsSchedulerRate,
t.optsMinMana,
t.optsMaxBufferSize,
t.optsMaxBufferSize,
),
Expand Down
2 changes: 1 addition & 1 deletion tools/evil-spammer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d
github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota-core/tools/genesis-snapshot v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388
github.com/mr-tron/base58 v1.2.0
go.uber.org/atomic v1.11.0
)
Expand Down
4 changes: 2 additions & 2 deletions tools/evil-spammer/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bf
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I=
github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d h1:ekHWRypoaiCXgrJVUQS7rCewsK3FuG1gTbPxu5jYn9c=
github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297 h1:kbpsa/gF0x6Cxu5lN9TL8u5EdaGv1P3/OKKPW0w83Og=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388 h1:IGqHrJRmrzfalf1py+FGWzkWoaA5o6avBSYWznVG08s=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
Expand Down
2 changes: 1 addition & 1 deletion tools/gendoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ require (
github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d // indirect
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e // indirect
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951 // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297 // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388 // indirect
github.com/ipfs/boxo v0.10.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions tools/gendoc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e h1:Mwoe7
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e/go.mod h1:jhzexR5X8m6qcmrwt5OX477O/ZwT7Ak9sPT83ByPkAo=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951 h1:qUf1W0fE1IyZzVy3Exv0Kj+SKECXG3S26c9m2ETb07U=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951/go.mod h1:c5778OnWpLq108YE+Eb2m8Ri/t/4ydV0TvI/Sy5YivQ=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297 h1:kbpsa/gF0x6Cxu5lN9TL8u5EdaGv1P3/OKKPW0w83Og=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388 h1:IGqHrJRmrzfalf1py+FGWzkWoaA5o6avBSYWznVG08s=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/ipfs/boxo v0.10.0 h1:tdDAxq8jrsbRkYoF+5Rcqyeb91hgWe2hp7iLu7ORZLY=
github.com/ipfs/boxo v0.10.0/go.mod h1:Fg+BnfxZ0RPzR0nOodzdIq3A7KgoWAOWsEIImrIQdBM=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
Expand Down
2 changes: 1 addition & 1 deletion tools/genesis-snapshot/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d
github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d
github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388
github.com/mr-tron/base58 v1.2.0
github.com/spf13/pflag v1.0.5
golang.org/x/crypto v0.13.0
Expand Down
4 changes: 2 additions & 2 deletions tools/genesis-snapshot/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bf
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I=
github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d h1:ekHWRypoaiCXgrJVUQS7rCewsK3FuG1gTbPxu5jYn9c=
github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297 h1:kbpsa/gF0x6Cxu5lN9TL8u5EdaGv1P3/OKKPW0w83Og=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003122130-2871888a9297/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388 h1:IGqHrJRmrzfalf1py+FGWzkWoaA5o6avBSYWznVG08s=
github.com/iotaledger/iota.go/v4 v4.0.0-20231003154311-26aa2f0fd388/go.mod h1:+e3bsJFDr9HxmUMe+eQOLNut5wfcB/ivhJdouOJgOnE=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
Expand Down

0 comments on commit cd61f77

Please sign in to comment.