From 774f26c1904ac3381bf7ef1c6c44348664404156 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 5 Dec 2023 15:28:09 +0000 Subject: [PATCH 01/10] incorporate protocol params with sanity checks --- go.mod | 2 +- go.sum | 4 +- pkg/protocol/chainmanager/manager_test.go | 20 +++---- .../accounts/accountsledger/testsuite_test.go | 8 +-- .../engine/accounts/mana/manager_test.go | 14 ++--- .../slotattestation/testframework_test.go | 8 +-- .../blockgadget/testframework_test.go | 10 ++-- pkg/protocol/engine/eviction/state_test.go | 20 +++---- .../post_solid_block_filter_test.go | 6 +- .../pre_solid_block_filter_test.go | 12 ++-- .../engine/mempool/v1/mempool_test.go | 4 +- .../engine/tipmanager/tests/testframework.go | 2 +- .../engine/utxoledger/iteration_test.go | 4 +- .../engine/utxoledger/manager_test.go | 4 +- pkg/protocol/engine/utxoledger/output_test.go | 20 +++---- .../engine/utxoledger/slot_diff_test.go | 6 +- .../engine/utxoledger/snapshot_test.go | 58 +++++++++---------- pkg/protocol/engine/utxoledger/tpkg/random.go | 4 +- .../seatmanager/topstakers/topstakers_test.go | 6 +- .../performance/testsuite_test.go | 4 +- pkg/storage/testframework_test.go | 2 +- pkg/tests/accounts_test.go | 58 +++---------------- pkg/tests/booker_test.go | 8 +-- pkg/tests/reward_test.go | 8 +-- pkg/tests/upgrade_signaling_test.go | 2 +- .../depositcalculator_test.go | 2 +- pkg/testsuite/testsuite.go | 48 +-------------- pkg/testsuite/testsuite_options.go | 33 ++++++----- tools/gendoc/go.mod | 2 +- tools/gendoc/go.sum | 4 +- tools/genesis-snapshot/go.mod | 2 +- tools/genesis-snapshot/go.sum | 4 +- tools/genesis-snapshot/presets/presets.go | 35 +++-------- 33 files changed, 154 insertions(+), 270 deletions(-) diff --git a/go.mod b/go.mod index 256f3d414..3042bf829 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 - github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6 + github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da github.com/labstack/echo/v4 v4.11.3 github.com/labstack/gommon v0.4.1 github.com/libp2p/go-libp2p v0.32.0 diff --git a/go.sum b/go.sum index 947972092..4fb7e6fa3 100644 --- a/go.sum +++ b/go.sum @@ -307,8 +307,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozra github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665/go.mod h1:obK1N42oafGA7EH6zC4VX2fKh7jTa3WnIa9h1azfxq0= -github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6 h1:Wuf8Ps3tzuZ5CCbl7LA5O2qwhfuXWo30RCOT0yhm4pg= -github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da h1:oNgrEVzIa4613fN7Prw9RCePT1wIF5UB1MnhoV/ys4M= +github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/pkg/protocol/chainmanager/manager_test.go b/pkg/protocol/chainmanager/manager_test.go index 21d24c997..79eb107ae 100644 --- a/pkg/protocol/chainmanager/manager_test.go +++ b/pkg/protocol/chainmanager/manager_test.go @@ -15,7 +15,7 @@ import ( ) func TestManager(t *testing.T) { - tf := NewTestFramework(t, tpkg.TestAPI) + tf := NewTestFramework(t, tpkg.ZeroCostTestAPI) tf.CreateCommitment("1", "Genesis", 10) tf.CreateCommitment("2", "1", 20) tf.CreateCommitment("3", "2", 30) @@ -213,7 +213,7 @@ func TestManager(t *testing.T) { } func TestManagerForkDetectedAgain(t *testing.T) { - tf := NewTestFramework(t, tpkg.TestAPI) + tf := NewTestFramework(t, tpkg.ZeroCostTestAPI) tf.CreateCommitment("1", "Genesis", 10) tf.CreateCommitment("2", "1", 20) tf.CreateCommitment("3", "2", 30) @@ -296,7 +296,7 @@ func TestManagerForkDetectedAgain(t *testing.T) { } func TestManagerForkDetectedReorgChains(t *testing.T) { - tf := NewTestFramework(t, tpkg.TestAPI) + tf := NewTestFramework(t, tpkg.ZeroCostTestAPI) tf.CreateCommitment("1", "Genesis", 10) tf.CreateCommitment("2", "1", 20) tf.CreateCommitment("3", "2", 30) @@ -368,9 +368,9 @@ func TestManagerForkDetectedReorgChains(t *testing.T) { } func TestEvaluateAgainstRootCommitment(t *testing.T) { - rootCommitment := iotago.NewCommitment(tpkg.TestAPI.Version(), 1, iotago.CommitmentIDRepresentingData(1, []byte{9}), iotago.Identifier{}, 0, 0) + rootCommitment := iotago.NewCommitment(tpkg.ZeroCostTestAPI.Version(), 1, iotago.CommitmentIDRepresentingData(1, []byte{9}), iotago.Identifier{}, 0, 0) - modelRootCommitment, err := model.CommitmentFromCommitment(rootCommitment, tpkg.TestAPI) + modelRootCommitment, err := model.CommitmentFromCommitment(rootCommitment, tpkg.ZeroCostTestAPI) require.NoError(t, err) m := &Manager{ @@ -379,7 +379,7 @@ func TestEvaluateAgainstRootCommitment(t *testing.T) { m.rootCommitment.PublishCommitment(modelRootCommitment) - isBelow, isRootCommitment := m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.TestAPI.Version(), 0, iotago.CommitmentIDRepresentingData(0, []byte{}), iotago.Identifier{}, 0, 0)) + isBelow, isRootCommitment := m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.ZeroCostTestAPI.Version(), 0, iotago.CommitmentIDRepresentingData(0, []byte{}), iotago.Identifier{}, 0, 0)) require.True(t, isBelow, "commitment with index 0 should be below root commitment") require.False(t, isRootCommitment, "commitment with index 0 should not be the root commitment") @@ -387,21 +387,21 @@ func TestEvaluateAgainstRootCommitment(t *testing.T) { require.True(t, isBelow, "commitment with index 1 should be below root commitment") require.True(t, isRootCommitment, "commitment with index 1 should be the root commitment") - isBelow, isRootCommitment = m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.TestAPI.Version(), 1, iotago.CommitmentIDRepresentingData(1, []byte{1}), iotago.Identifier{}, 0, 0)) + isBelow, isRootCommitment = m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.ZeroCostTestAPI.Version(), 1, iotago.CommitmentIDRepresentingData(1, []byte{1}), iotago.Identifier{}, 0, 0)) require.True(t, isBelow, "commitment with index 1 should be below root commitment") require.False(t, isRootCommitment, "commitment with index 1 should be the root commitment") - isBelow, isRootCommitment = m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.TestAPI.Version(), 1, iotago.CommitmentIDRepresentingData(1, []byte{9}), iotago.Identifier{}, 0, 0)) + isBelow, isRootCommitment = m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.ZeroCostTestAPI.Version(), 1, iotago.CommitmentIDRepresentingData(1, []byte{9}), iotago.Identifier{}, 0, 0)) require.True(t, isBelow, "commitment with index 1 should be below root commitment") require.True(t, isRootCommitment, "commitment with index 1 should be the root commitment") - isBelow, isRootCommitment = m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.TestAPI.Version(), 2, iotago.CommitmentIDRepresentingData(2, []byte{}), iotago.Identifier{}, 0, 0)) + isBelow, isRootCommitment = m.evaluateAgainstRootCommitment(iotago.NewCommitment(tpkg.ZeroCostTestAPI.Version(), 2, iotago.CommitmentIDRepresentingData(2, []byte{}), iotago.Identifier{}, 0, 0)) require.False(t, isBelow, "commitment with index 2 should not be below root commitment") require.False(t, isRootCommitment, "commitment with index 2 should not be the root commitment") } func TestProcessCommitment(t *testing.T) { - tf := NewTestFramework(t, tpkg.TestAPI) + tf := NewTestFramework(t, tpkg.ZeroCostTestAPI) tf.CreateCommitment("1", "Genesis", 10) tf.CreateCommitment("2", "1", 20) diff --git a/pkg/protocol/engine/accounts/accountsledger/testsuite_test.go b/pkg/protocol/engine/accounts/accountsledger/testsuite_test.go index 51f2247bc..fecb06637 100644 --- a/pkg/protocol/engine/accounts/accountsledger/testsuite_test.go +++ b/pkg/protocol/engine/accounts/accountsledger/testsuite_test.go @@ -38,7 +38,7 @@ type TestSuite struct { } func NewTestSuite(test *testing.T) *TestSuite { - testAPI := tpkg.TestAPI + testAPI := tpkg.ZeroCostTestAPI t := &TestSuite{ T: test, @@ -65,7 +65,7 @@ func (t *TestSuite) initAccountLedger() *accountsledger.Manager { prunableStores[slot] = mapdb.NewMapDB() } - p := slotstore.NewAccountDiffs(slot, prunableStores[slot], tpkg.TestAPI) + p := slotstore.NewAccountDiffs(slot, prunableStores[slot], tpkg.ZeroCostTestAPI) return p, nil } @@ -187,8 +187,8 @@ func (t *TestSuite) ApplySlotActions(slot iotago.SlotIndex, rmc iotago.Mana, act } func (t *TestSuite) createBlockWithRMC(accountID iotago.AccountID, slot iotago.SlotIndex, rmc iotago.Mana) *blocks.Block { - innerBlock := tpkg.RandBasicBlockWithIssuerAndRMC(tpkg.TestAPI, accountID, rmc) - innerBlock.Header.IssuingTime = tpkg.TestAPI.TimeProvider().SlotStartTime(slot) + innerBlock := tpkg.RandBasicBlockWithIssuerAndRMC(tpkg.ZeroCostTestAPI, accountID, rmc) + innerBlock.Header.IssuingTime = tpkg.ZeroCostTestAPI.TimeProvider().SlotStartTime(slot) modelBlock, err := model.BlockFromBlock(innerBlock) require.NoError(t.T, err) diff --git a/pkg/protocol/engine/accounts/mana/manager_test.go b/pkg/protocol/engine/accounts/mana/manager_test.go index 62301750c..352b7857e 100644 --- a/pkg/protocol/engine/accounts/mana/manager_test.go +++ b/pkg/protocol/engine/accounts/mana/manager_test.go @@ -24,7 +24,7 @@ func TestManager_GetManaOnAccountOverflow(t *testing.T) { switch id { case accountIDOverflow: return utxoledger.CreateOutput( - iotago.SingleVersionProvider(tpkg.TestAPI), + iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), iotago.OutputIDFromTransactionIDAndIndex(iotago.NewTransactionID(0, tpkg.Rand32ByteArray()), 0), tpkg.RandBlockID(), tpkg.RandSlot(), @@ -33,11 +33,11 @@ func TestManager_GetManaOnAccountOverflow(t *testing.T) { Mana: iotago.MaxMana/2 + iotago.MaxMana/4, AccountID: accountIDOverflow, }, - lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.TestAPI, tpkg.Rand32ByteArray(), tpkg.RandSlot(), iotago.TxEssenceOutputs{tpkg.RandBasicOutput(iotago.AddressEd25519)}, 0)), + lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.ZeroCostTestAPI, tpkg.Rand32ByteArray(), tpkg.RandSlot(), iotago.TxEssenceOutputs{tpkg.RandBasicOutput(iotago.AddressEd25519)}, 0)), ), nil case accountIDRecentOutput: return utxoledger.CreateOutput( - iotago.SingleVersionProvider(tpkg.TestAPI), + iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), iotago.OutputIDFromTransactionIDAndIndex(iotago.NewTransactionID(1, tpkg.Rand32ByteArray()), 0), tpkg.RandBlockID(), tpkg.RandSlot(), @@ -46,11 +46,11 @@ func TestManager_GetManaOnAccountOverflow(t *testing.T) { Mana: iotago.MaxMana / 2, AccountID: id, }, - lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.TestAPI, tpkg.Rand32ByteArray(), tpkg.RandSlot(), iotago.TxEssenceOutputs{tpkg.RandBasicOutput(iotago.AddressEd25519)}, 0)), + lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.ZeroCostTestAPI, tpkg.Rand32ByteArray(), tpkg.RandSlot(), iotago.TxEssenceOutputs{tpkg.RandBasicOutput(iotago.AddressEd25519)}, 0)), ), nil default: return utxoledger.CreateOutput( - iotago.SingleVersionProvider(tpkg.TestAPI), + iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), iotago.OutputIDFromTransactionIDAndIndex(iotago.NewTransactionID(0, tpkg.Rand32ByteArray()), 0), tpkg.RandBlockID(), tpkg.RandSlot(), @@ -59,7 +59,7 @@ func TestManager_GetManaOnAccountOverflow(t *testing.T) { Mana: iotago.MaxMana / 2, AccountID: id, }, - lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.TestAPI, tpkg.Rand32ByteArray(), tpkg.RandSlot(), iotago.TxEssenceOutputs{tpkg.RandBasicOutput(iotago.AddressEd25519)}, 0)), + lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.ZeroCostTestAPI, tpkg.Rand32ByteArray(), tpkg.RandSlot(), iotago.TxEssenceOutputs{tpkg.RandBasicOutput(iotago.AddressEd25519)}, 0)), ), nil } } @@ -100,7 +100,7 @@ func TestManager_GetManaOnAccountOverflow(t *testing.T) { } } - manager := NewManager(iotago.SingleVersionProvider(tpkg.TestAPI), outputRetriever, accountRetriever) + manager := NewManager(iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), outputRetriever, accountRetriever) manaDecayProvider := manager.apiProvider.LatestAPI().ManaDecayProvider() // The value for this account will overflow because component values are too big. diff --git a/pkg/protocol/engine/attestation/slotattestation/testframework_test.go b/pkg/protocol/engine/attestation/slotattestation/testframework_test.go index ed0cef175..624158d66 100644 --- a/pkg/protocol/engine/attestation/slotattestation/testframework_test.go +++ b/pkg/protocol/engine/attestation/slotattestation/testframework_test.go @@ -69,13 +69,7 @@ func NewTestFramework(test *testing.T) *TestFramework { return accounts.SelectCommittee(members...), true } - t.testAPI = iotago.V3API( - iotago.NewV3ProtocolParameters( - iotago.WithNetworkOptions("TestJungle", "tgl"), - iotago.WithSupplyOptions(10000, 0, 0, 0, 0, 0, 0), - iotago.WithLivenessOptions(10, 10, 1, 2, 8), - ), - ) + t.testAPI = iotago.V3API(iotago.NewV3TestProtocolParameters()) t.apiProvider = iotago.SingleVersionProvider(t.testAPI) diff --git a/pkg/protocol/engine/consensus/blockgadget/testframework_test.go b/pkg/protocol/engine/consensus/blockgadget/testframework_test.go index aaea4179f..486b4a8c9 100644 --- a/pkg/protocol/engine/consensus/blockgadget/testframework_test.go +++ b/pkg/protocol/engine/consensus/blockgadget/testframework_test.go @@ -42,7 +42,7 @@ func NewTestFramework(test *testing.T) *TestFramework { T: test, blocks: shrinkingmap.New[string, *blocks.Block](), - SeatManager: mock.NewManualPOA(iotago.SingleVersionProvider(tpkg.TestAPI), epochstore.NewStore(kvstore.Realm{}, mapdb.NewMapDB(), 0, (*account.Accounts).Bytes, account.AccountsFromBytes)), + SeatManager: mock.NewManualPOA(iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), epochstore.NewStore(kvstore.Realm{}, mapdb.NewMapDB(), 0, (*account.Accounts).Bytes, account.AccountsFromBytes)), } evictionState := eviction.NewState(mapdb.NewMapDB(), func(slot iotago.SlotIndex) (*slotstore.Store[iotago.BlockID, iotago.CommitmentID], error) { @@ -53,10 +53,10 @@ func NewTestFramework(test *testing.T) *TestFramework { iotago.CommitmentIDFromBytes, ), nil }, func() iotago.BlockID { - return tpkg.TestAPI.ProtocolParameters().GenesisBlockID() + return tpkg.ZeroCostTestAPI.ProtocolParameters().GenesisBlockID() }) - t.blockCache = blocks.New(evictionState, iotago.SingleVersionProvider(tpkg.TestAPI)) + t.blockCache = blocks.New(evictionState, iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI)) instance := thresholdblockgadget.New(t.blockCache, t.SeatManager, func(err error) { fmt.Printf(">> Gadget.Error: %s\n", err) }) @@ -64,7 +64,7 @@ func NewTestFramework(test *testing.T) *TestFramework { t.Events = instance.Events() t.Instance = instance - genesisBlock := blocks.NewRootBlock(tpkg.TestAPI.ProtocolParameters().GenesisBlockID(), iotago.NewEmptyCommitment(tpkg.TestAPI).MustID(), time.Unix(tpkg.TestAPI.TimeProvider().GenesisUnixTime(), 0)) + genesisBlock := blocks.NewRootBlock(tpkg.ZeroCostTestAPI.ProtocolParameters().GenesisBlockID(), iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID(), time.Unix(tpkg.ZeroCostTestAPI.TimeProvider().GenesisUnixTime(), 0)) t.blocks.Set("Genesis", genesisBlock) genesisBlock.ID().RegisterAlias("Genesis") evictionState.AddRootBlock(genesisBlock.ID(), genesisBlock.SlotCommitmentID()) @@ -106,7 +106,7 @@ func (t *TestFramework) CreateBlock(alias string, issuerAlias string, parents .. _, priv, err := ed25519.GenerateKey(nil) require.NoError(t, err) - block, err := builder.NewValidationBlockBuilder(tpkg.TestAPI). + block, err := builder.NewValidationBlockBuilder(tpkg.ZeroCostTestAPI). StrongParents(t.BlockIDs(parents...)). Sign(t.SeatManager.AccountID(issuerAlias), priv). IssuingTime(time.Now()). diff --git a/pkg/protocol/engine/eviction/state_test.go b/pkg/protocol/engine/eviction/state_test.go index 5d77aa992..515dae6da 100644 --- a/pkg/protocol/engine/eviction/state_test.go +++ b/pkg/protocol/engine/eviction/state_test.go @@ -19,24 +19,24 @@ func TestState_RootBlocks(t *testing.T) { prunableStorage := prunable.New(database.Config{ Engine: hivedb.EngineMapDB, Directory: t.TempDir(), - }, iotago.SingleVersionProvider(tpkg.TestAPI), errorHandler) + }, iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), errorHandler) ts := NewTestFramework(t, prunableStorage, eviction.NewState(mapdb.NewMapDB(), prunableStorage.RootBlocks, func() iotago.BlockID { - return tpkg.TestAPI.ProtocolParameters().GenesisBlockID() + return tpkg.ZeroCostTestAPI.ProtocolParameters().GenesisBlockID() }, eviction.WithRootBlocksEvictionDelay(3))) - ts.CreateAndAddRootBlock("Genesis", 0, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) + ts.CreateAndAddRootBlock("Genesis", 0, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) ts.RequireActiveRootBlocks("Genesis") ts.RequireLastEvictedSlot(0) ts.Instance.Initialize(0) - ts.CreateAndAddRootBlock("Root1.0", 1, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) - ts.CreateAndAddRootBlock("Root1.1", 1, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) - ts.CreateAndAddRootBlock("Root2.0", 2, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) - ts.CreateAndAddRootBlock("Root3.0", 3, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) - ts.CreateAndAddRootBlock("Root4.0", 4, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) - ts.CreateAndAddRootBlock("Root4.1", 4, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) - ts.CreateAndAddRootBlock("Root5.0", 5, iotago.NewEmptyCommitment(tpkg.TestAPI).MustID()) + ts.CreateAndAddRootBlock("Root1.0", 1, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) + ts.CreateAndAddRootBlock("Root1.1", 1, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) + ts.CreateAndAddRootBlock("Root2.0", 2, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) + ts.CreateAndAddRootBlock("Root3.0", 3, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) + ts.CreateAndAddRootBlock("Root4.0", 4, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) + ts.CreateAndAddRootBlock("Root4.1", 4, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) + ts.CreateAndAddRootBlock("Root5.0", 5, iotago.NewEmptyCommitment(tpkg.ZeroCostTestAPI).MustID()) ts.RequireActiveRootBlocks("Genesis") ts.RequireLastEvictedSlot(0) diff --git a/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go b/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go index e996b2990..10fff4fc3 100644 --- a/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go +++ b/pkg/protocol/engine/filter/postsolidfilter/postsolidblockfilter/post_solid_block_filter_test.go @@ -117,7 +117,7 @@ func (t *TestFramework) IssueSignedBlockAtSlotWithBurnedMana(alias string, slot } func TestPostSolidFilter_NoAccount(t *testing.T) { - testAPI := tpkg.TestAPI + testAPI := tpkg.ZeroCostTestAPI tf := NewTestFramework(t, iotago.SingleVersionProvider(testAPI), @@ -179,7 +179,7 @@ func TestPostSolidFilter_NoAccount(t *testing.T) { } func TestPostSolidFilter_BurnedMana(t *testing.T) { - testAPI := tpkg.TestAPI + testAPI := tpkg.ZeroCostTestAPI tf := NewTestFramework(t, iotago.SingleVersionProvider(testAPI), @@ -227,7 +227,7 @@ func TestPostSolidFilter_BurnedMana(t *testing.T) { } func TestPostSolidFilter_Expiry(t *testing.T) { - testAPI := tpkg.TestAPI + testAPI := tpkg.ZeroCostTestAPI tf := NewTestFramework(t, iotago.SingleVersionProvider(testAPI), diff --git a/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go b/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go index df0809625..8496ac6d6 100644 --- a/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go +++ b/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go @@ -111,7 +111,7 @@ func mockedCommitteeFunc(validatorAccountID iotago.AccountID) func(iotago.SlotIn func TestFilter_WithMaxAllowedWallClockDrift(t *testing.T) { allowedDrift := 3 * time.Second - testAPI := tpkg.TestAPI + testAPI := tpkg.ZeroCostTestAPI tf := NewTestFramework(t, iotago.SingleVersionProvider(testAPI), @@ -137,12 +137,12 @@ func TestFilter_ProtocolVersion(t *testing.T) { apiProvider := iotago.NewEpochBasedProvider( iotago.WithAPIForMissingVersionCallback( func(params iotago.ProtocolParameters) (iotago.API, error) { - return iotago.V3API(iotago.NewV3ProtocolParameters(iotago.WithVersion(params.Version()))), nil + return iotago.V3API(iotago.NewV3TestProtocolParameters(iotago.WithVersion(params.Version()))), nil }, ), ) - apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3ProtocolParameters(iotago.WithVersion(3)), 0) - apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3ProtocolParameters(iotago.WithVersion(4)), 3) + apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3TestProtocolParameters(iotago.WithVersion(3)), 0) + apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3TestProtocolParameters(iotago.WithVersion(4)), 3) timeProvider := apiProvider.CommittedAPI().TimeProvider() @@ -187,7 +187,7 @@ func TestFilter_ProtocolVersion(t *testing.T) { valid.Add("G") require.NoError(t, tf.IssueBlockAtSlotWithVersion("G", timeProvider.EpochStart(5)+5, 4, apiProvider)) - apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3ProtocolParameters(iotago.WithVersion(5)), 10) + apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3TestProtocolParameters(iotago.WithVersion(5)), 10) valid.Add("H") require.NoError(t, tf.IssueBlockAtSlotWithVersion("H", timeProvider.EpochEnd(9), 4, apiProvider)) @@ -200,7 +200,7 @@ func TestFilter_ProtocolVersion(t *testing.T) { } func TestFilter_ValidationBlocks(t *testing.T) { - testAPI := tpkg.TestAPI + testAPI := tpkg.ZeroCostTestAPI tf := NewTestFramework(t, iotago.SingleVersionProvider(testAPI), diff --git a/pkg/protocol/engine/mempool/v1/mempool_test.go b/pkg/protocol/engine/mempool/v1/mempool_test.go index 13c786fee..606e02efd 100644 --- a/pkg/protocol/engine/mempool/v1/mempool_test.go +++ b/pkg/protocol/engine/mempool/v1/mempool_test.go @@ -39,7 +39,7 @@ func TestMempoolV1_ResourceCleanup(t *testing.T) { spendDAG := spenddagv1.New[iotago.TransactionID, mempool.StateID, vote.MockedRank](func() int { return 0 }) memPoolInstance := New[vote.MockedRank](new(mempooltests.VM), func(reference mempool.StateReference) *promise.Promise[mempool.State] { return ledgerState.ResolveOutputState(reference) - }, mutationsFunc, workers, spendDAG, iotago.SingleVersionProvider(tpkg.TestAPI), func(error) {}) + }, mutationsFunc, workers, spendDAG, iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), func(error) {}) tf := mempooltests.NewTestFramework(t, memPoolInstance, spendDAG, ledgerState, workers) @@ -149,5 +149,5 @@ func newTestFramework(t *testing.T) *mempooltests.TestFramework { return mempooltests.NewTestFramework(t, New[vote.MockedRank](new(mempooltests.VM), func(reference mempool.StateReference) *promise.Promise[mempool.State] { return ledgerState.ResolveOutputState(reference) - }, mutationsFunc, workers, spendDAG, iotago.SingleVersionProvider(tpkg.TestAPI), func(error) {}), spendDAG, ledgerState, workers) + }, mutationsFunc, workers, spendDAG, iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), func(error) {}), spendDAG, ledgerState, workers) } diff --git a/pkg/protocol/engine/tipmanager/tests/testframework.go b/pkg/protocol/engine/tipmanager/tests/testframework.go index 7b67a1524..781dc41b9 100644 --- a/pkg/protocol/engine/tipmanager/tests/testframework.go +++ b/pkg/protocol/engine/tipmanager/tests/testframework.go @@ -34,7 +34,7 @@ func NewTestFramework(test *testing.T) *TestFramework { tipMetadataByAlias: make(map[string]tipmanager.TipMetadata), blocksByID: make(map[iotago.BlockID]*blocks.Block), test: test, - API: tpkg.TestAPI, + API: tpkg.ZeroCostTestAPI, } t.blockIDsByAlias["Genesis"] = iotago.EmptyBlockID diff --git a/pkg/protocol/engine/utxoledger/iteration_test.go b/pkg/protocol/engine/utxoledger/iteration_test.go index 12a3ab370..b2243e2d6 100644 --- a/pkg/protocol/engine/utxoledger/iteration_test.go +++ b/pkg/protocol/engine/utxoledger/iteration_test.go @@ -14,7 +14,7 @@ import ( ) func TestUTXOComputeBalance(t *testing.T) { - manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) initialOutput := tpkg.RandLedgerStateOutputOnAddressWithAmount(iotago.OutputBasic, iotago_tpkg.RandAddress(iotago.AddressEd25519), 2_134_656_365) require.NoError(t, manager.AddGenesisUnspentOutput(initialOutput)) @@ -51,7 +51,7 @@ func TestUTXOComputeBalance(t *testing.T) { } func TestUTXOIteration(t *testing.T) { - manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) outputs := utxoledger.Outputs{ tpkg.RandLedgerStateOutputOnAddress(iotago.OutputBasic, iotago_tpkg.RandAddress(iotago.AddressEd25519)), diff --git a/pkg/protocol/engine/utxoledger/manager_test.go b/pkg/protocol/engine/utxoledger/manager_test.go index 1e046fc27..0f2f179d3 100644 --- a/pkg/protocol/engine/utxoledger/manager_test.go +++ b/pkg/protocol/engine/utxoledger/manager_test.go @@ -14,7 +14,7 @@ import ( ) func TestConfirmationApplyAndRollbackToEmptyLedger(t *testing.T) { - manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) outputs := utxoledger.Outputs{ tpkg.RandLedgerStateOutputWithType(iotago.OutputBasic), @@ -88,7 +88,7 @@ func TestConfirmationApplyAndRollbackToEmptyLedger(t *testing.T) { } func TestConfirmationApplyAndRollbackToPreviousLedger(t *testing.T) { - manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) previousOutputs := utxoledger.Outputs{ tpkg.RandLedgerStateOutputWithType(iotago.OutputBasic), diff --git a/pkg/protocol/engine/utxoledger/output_test.go b/pkg/protocol/engine/utxoledger/output_test.go index 65968b7b5..c9ce53097 100644 --- a/pkg/protocol/engine/utxoledger/output_test.go +++ b/pkg/protocol/engine/utxoledger/output_test.go @@ -21,7 +21,7 @@ import ( func AssertOutputUnspentAndSpentTransitions(t *testing.T, output *utxoledger.Output, spent *utxoledger.Spent) { outputID := output.OutputID() - manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, manager.AddGenesisUnspentOutput(output)) @@ -80,7 +80,7 @@ func CreateOutputAndAssertSerialization(t *testing.T, blockID iotago.BlockID, in outputID, err := outputProof.OutputID(iotaOutput) require.NoError(t, err) - iotagoAPI := iotago_tpkg.TestAPI + iotagoAPI := iotago_tpkg.ZeroCostTestAPI output := utxoledger.CreateOutput(iotago.SingleVersionProvider(iotagoAPI), outputID, blockID, indexBooked, iotaOutput, outputProof) outputBytes, err := iotagoAPI.Encode(output.Output()) require.NoError(t, err) @@ -152,7 +152,7 @@ func TestBasicOutputOnEd25519WithoutSpendConstraintsSerialization(t *testing.T) }, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) @@ -190,7 +190,7 @@ func TestBasicOutputOnEd25519WithSpendConstraintsSerialization(t *testing.T) { }, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) @@ -229,7 +229,7 @@ func TestNFTOutputSerialization(t *testing.T) { }, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) @@ -276,7 +276,7 @@ func TestNFTOutputWithSpendConstraintsSerialization(t *testing.T) { }, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) @@ -318,7 +318,7 @@ func TestAccountOutputSerialization(t *testing.T) { }, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) @@ -364,7 +364,7 @@ func TestAnchorOutputSerialization(t *testing.T) { }, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) @@ -401,7 +401,7 @@ func TestFoundryOutputSerialization(t *testing.T) { ImmutableFeatures: iotago.FoundryOutputImmFeatures{}, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) @@ -433,7 +433,7 @@ func TestDelegationOutputSerialization(t *testing.T) { }, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txCommitment, txCreationSlot, iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) output := CreateOutputAndAssertSerialization(t, blockID, index, iotaOutput, outputProof) diff --git a/pkg/protocol/engine/utxoledger/slot_diff_test.go b/pkg/protocol/engine/utxoledger/slot_diff_test.go index e39a3b510..ad8982831 100644 --- a/pkg/protocol/engine/utxoledger/slot_diff_test.go +++ b/pkg/protocol/engine/utxoledger/slot_diff_test.go @@ -35,10 +35,10 @@ func TestSimpleSlotDiffSerialization(t *testing.T) { Features: iotago.BasicOutputFeatures{}, } - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) - output := utxoledger.CreateOutput(iotago.SingleVersionProvider(iotago_tpkg.TestAPI), outputID, blockID, indexBooked, iotaOutput, outputProof) + output := utxoledger.CreateOutput(iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI), outputID, blockID, indexBooked, iotaOutput, outputProof) transactionIDSpent := iotago_tpkg.RandTransactionID() @@ -63,7 +63,7 @@ func TestSimpleSlotDiffSerialization(t *testing.T) { } func TestSlotDiffSerialization(t *testing.T) { - manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) outputs := utxoledger.Outputs{ tpkg.RandLedgerStateOutputWithType(iotago.OutputBasic), diff --git a/pkg/protocol/engine/utxoledger/snapshot_test.go b/pkg/protocol/engine/utxoledger/snapshot_test.go index ba1c5dd38..1e220077d 100644 --- a/pkg/protocol/engine/utxoledger/snapshot_test.go +++ b/pkg/protocol/engine/utxoledger/snapshot_test.go @@ -23,16 +23,16 @@ func TestOutput_SnapshotBytes(t *testing.T) { txID := iotago_tpkg.RandTransactionID() slotBooked := iotago_tpkg.RandSlot() iotaOutput := iotago_tpkg.RandOutput(iotago.OutputBasic) - iotaOutputBytes, err := iotago_tpkg.TestAPI.Encode(iotaOutput) + iotaOutputBytes, err := iotago_tpkg.ZeroCostTestAPI.Encode(iotaOutput) require.NoError(t, err) - proof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) + proof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) proofBytes, err := proof.Bytes() require.NoError(t, err) - output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.TestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, proof, proofBytes) + output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, proof, proofBytes) snapshotBytes := output.SnapshotBytes() @@ -58,19 +58,19 @@ func TestOutputFromSnapshotReader(t *testing.T) { blockID := iotago_tpkg.RandBlockID() slotBooked := iotago_tpkg.RandSlot() iotaOutput := iotago_tpkg.RandOutput(iotago.OutputBasic) - iotaOutputBytes, err := iotago_tpkg.TestAPI.Encode(iotaOutput) + iotaOutputBytes, err := iotago_tpkg.ZeroCostTestAPI.Encode(iotaOutput) require.NoError(t, err) - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) outputProofBytes, err := outputProof.Bytes() require.NoError(t, err) - output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.TestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, outputProof, outputProofBytes) + output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, outputProof, outputProofBytes) snapshotBytes := output.SnapshotBytes() buf := bytes.NewReader(snapshotBytes) - readOutput, err := utxoledger.OutputFromSnapshotReader(buf, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + readOutput, err := utxoledger.OutputFromSnapshotReader(buf, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) require.Equal(t, output, readOutput) @@ -82,15 +82,15 @@ func TestSpent_SnapshotBytes(t *testing.T) { blockID := iotago_tpkg.RandBlockID() slotBooked := iotago_tpkg.RandSlot() iotaOutput := iotago_tpkg.RandOutput(iotago.OutputBasic) - iotaOutputBytes, err := iotago_tpkg.TestAPI.Encode(iotaOutput) + iotaOutputBytes, err := iotago_tpkg.ZeroCostTestAPI.Encode(iotaOutput) require.NoError(t, err) - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) outputProofBytes, err := outputProof.Bytes() require.NoError(t, err) - output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.TestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, outputProof, outputProofBytes) + output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, outputProof, outputProofBytes) outputSnapshotBytes := output.SnapshotBytes() transactionID := iotago_tpkg.RandTransactionID() @@ -111,15 +111,15 @@ func TestSpentFromSnapshotReader(t *testing.T) { blockID := iotago_tpkg.RandBlockID() slotBooked := iotago_tpkg.RandSlot() iotaOutput := iotago_tpkg.RandOutput(iotago.OutputBasic) - iotaOutputBytes, err := iotago_tpkg.TestAPI.Encode(iotaOutput) + iotaOutputBytes, err := iotago_tpkg.ZeroCostTestAPI.Encode(iotaOutput) require.NoError(t, err) - outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.TestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) + outputProof, err := iotago.NewOutputIDProof(iotago_tpkg.ZeroCostTestAPI, txID.Identifier(), txID.Slot(), iotago.TxEssenceOutputs{iotaOutput}, 0) require.NoError(t, err) outputProofBytes, err := outputProof.Bytes() require.NoError(t, err) - output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.TestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, outputProof, outputProofBytes) + output := utxoledger.NewOutput(iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI), outputID, blockID, slotBooked, iotaOutput, iotaOutputBytes, outputProof, outputProofBytes) transactionID := iotago_tpkg.RandTransactionID() slotSpent := iotago_tpkg.RandSlot() @@ -128,7 +128,7 @@ func TestSpentFromSnapshotReader(t *testing.T) { snapshotBytes := spent.SnapshotBytes() buf := bytes.NewReader(snapshotBytes) - readSpent, err := utxoledger.SpentFromSnapshotReader(buf, iotago.SingleVersionProvider(iotago_tpkg.TestAPI), slotSpent) + readSpent, err := utxoledger.SpentFromSnapshotReader(buf, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI), slotSpent) require.NoError(t, err) require.Equal(t, spent, readSpent) @@ -154,7 +154,7 @@ func TestReadSlotDiffToSnapshotReader(t *testing.T) { require.NoError(t, err) reader := writer.Reader() - readSlotDiff, err := utxoledger.ReadSlotDiffToSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + readSlotDiff, err := utxoledger.ReadSlotDiffToSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) require.Equal(t, slotDiff.Slot, readSlotDiff.Slot) @@ -193,7 +193,7 @@ func TestWriteSlotDiffToSnapshotWriter(t *testing.T) { var snapshotOutputs utxoledger.Outputs for i := 0; i < len(slotDiff.Outputs); i++ { - readOutput, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + readOutput, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) snapshotOutputs = append(snapshotOutputs, readOutput) } @@ -206,7 +206,7 @@ func TestWriteSlotDiffToSnapshotWriter(t *testing.T) { var snapshotSpents utxoledger.Spents for i := 0; i < len(slotDiff.Spents); i++ { - readSpent, err := utxoledger.SpentFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI), readSlot) + readSpent, err := utxoledger.SpentFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI), readSlot) require.NoError(t, err) snapshotSpents = append(snapshotSpents, readSpent) } @@ -216,7 +216,7 @@ func TestWriteSlotDiffToSnapshotWriter(t *testing.T) { func TestManager_Import(t *testing.T) { mapDB := mapdb.NewMapDB() - manager := utxoledger.New(mapDB, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapDB, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) output1 := tpkg.RandLedgerStateOutput() @@ -270,7 +270,7 @@ func TestManager_Import(t *testing.T) { reader := writer.Reader() - importedSlot2 := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + importedSlot2 := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, importedSlot2.Import(reader)) require.Equal(t, iotago.SlotIndex(2), lo.PanicOnErr(importedSlot2.ReadLedgerSlot())) @@ -284,10 +284,10 @@ func TestManager_Import(t *testing.T) { reader := writer.Reader() - importedSlot1 := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + importedSlot1 := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, importedSlot1.Import(reader)) - managerAtSlot1 := utxoledger.New(mapDBAtSlot1, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + managerAtSlot1 := utxoledger.New(mapDBAtSlot1, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.Equal(t, iotago.SlotIndex(1), lo.PanicOnErr(importedSlot1.ReadLedgerSlot())) require.Equal(t, iotago.SlotIndex(1), lo.PanicOnErr(managerAtSlot1.ReadLedgerSlot())) @@ -301,10 +301,10 @@ func TestManager_Import(t *testing.T) { reader := writer.Reader() - importedSlot0 := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + importedSlot0 := utxoledger.New(mapdb.NewMapDB(), iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, importedSlot0.Import(reader)) - managerAtSlot0 := utxoledger.New(mapDBAtSlot0, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + managerAtSlot0 := utxoledger.New(mapDBAtSlot0, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.Equal(t, iotago.SlotIndex(0), lo.PanicOnErr(importedSlot0.ReadLedgerSlot())) require.Equal(t, iotago.SlotIndex(0), lo.PanicOnErr(managerAtSlot0.ReadLedgerSlot())) @@ -314,7 +314,7 @@ func TestManager_Import(t *testing.T) { func TestManager_Export(t *testing.T) { mapDB := mapdb.NewMapDB() - manager := utxoledger.New(mapDB, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + manager := utxoledger.New(mapDB, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) output1 := tpkg.RandLedgerStateOutput() @@ -367,7 +367,7 @@ func TestManager_Export(t *testing.T) { var snapshotOutputs utxoledger.Outputs for i := uint64(0); i < outputCount; i++ { - output, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + output, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) snapshotOutputs = append(snapshotOutputs, output) } @@ -400,7 +400,7 @@ func TestManager_Export(t *testing.T) { var snapshotOutputs utxoledger.Outputs for i := uint64(0); i < outputCount; i++ { - output, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + output, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) snapshotOutputs = append(snapshotOutputs, output) } @@ -415,7 +415,7 @@ func TestManager_Export(t *testing.T) { require.Equal(t, uint32(1), slotDiffCount) for i := uint32(0); i < slotDiffCount; i++ { - diff, err := utxoledger.ReadSlotDiffToSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + diff, err := utxoledger.ReadSlotDiffToSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) require.Equal(t, snapshotLedgerSlot-iotago.SlotIndex(i), diff.Slot) } @@ -438,7 +438,7 @@ func TestManager_Export(t *testing.T) { var snapshotOutputs utxoledger.Outputs for i := uint64(0); i < outputCount; i++ { - output, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + output, err := utxoledger.OutputFromSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) snapshotOutputs = append(snapshotOutputs, output) } @@ -453,7 +453,7 @@ func TestManager_Export(t *testing.T) { require.Equal(t, uint32(2), slotDiffCount) for i := uint32(0); i < slotDiffCount; i++ { - diff, err := utxoledger.ReadSlotDiffToSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.TestAPI)) + diff, err := utxoledger.ReadSlotDiffToSnapshotReader(reader, iotago.SingleVersionProvider(iotago_tpkg.ZeroCostTestAPI)) require.NoError(t, err) require.Equal(t, snapshotLedgerSlot-iotago.SlotIndex(i), diff.Slot) } diff --git a/pkg/protocol/engine/utxoledger/tpkg/random.go b/pkg/protocol/engine/utxoledger/tpkg/random.go index 627516475..20804f477 100644 --- a/pkg/protocol/engine/utxoledger/tpkg/random.go +++ b/pkg/protocol/engine/utxoledger/tpkg/random.go @@ -14,9 +14,9 @@ func RandLedgerStateOutput() *utxoledger.Output { func RandLedgerStateOutputWithOutput(output iotago.Output) *utxoledger.Output { outputs := iotago.TxEssenceOutputs{output} txID := tpkg.RandTransactionID() - proof := lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.TestAPI, txID.Identifier(), txID.Slot(), outputs, 0)) + proof := lo.PanicOnErr(iotago.NewOutputIDProof(tpkg.ZeroCostTestAPI, txID.Identifier(), txID.Slot(), outputs, 0)) - return utxoledger.CreateOutput(iotago.SingleVersionProvider(tpkg.TestAPI), tpkg.RandOutputID(), tpkg.RandBlockID(), tpkg.RandSlot(), outputs[0], proof) + return utxoledger.CreateOutput(iotago.SingleVersionProvider(tpkg.ZeroCostTestAPI), tpkg.RandOutputID(), tpkg.RandBlockID(), tpkg.RandSlot(), outputs[0], proof) } func RandLedgerStateOutputWithType(outputType iotago.OutputType) *utxoledger.Output { diff --git a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go index 53a49290a..317a1e824 100644 --- a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go +++ b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go @@ -22,8 +22,7 @@ import ( func TestTopStakers_InitializeCommittee(t *testing.T) { var testAPI = iotago.V3API( - iotago.NewV3ProtocolParameters( - iotago.WithNetworkOptions("TestJungle", "tgl"), + iotago.NewV3TestProtocolParameters( iotago.WithSupplyOptions(2_779_530_283_277_761, 0, 0, 0, 0, 0, 0), iotago.WithWorkScoreOptions(0, 1, 0, 0, 0, 0, 0, 0, 0, 0), // all zero except block offset gives all blocks workscore = 1 iotago.WithTargetCommitteeSize(3), @@ -76,8 +75,7 @@ func TestTopStakers_InitializeCommittee(t *testing.T) { func TestTopStakers_RotateCommittee(t *testing.T) { var testAPI = iotago.V3API( - iotago.NewV3ProtocolParameters( - iotago.WithNetworkOptions("TestJungle", "tgl"), + iotago.NewV3TestProtocolParameters( iotago.WithSupplyOptions(2_779_530_283_277_761, 0, 0, 0, 0, 0, 0), iotago.WithWorkScoreOptions(0, 1, 0, 0, 0, 0, 0, 0, 0, 0), // all zero except block offset gives all blocks workscore = 1 iotago.WithTargetCommitteeSize(10), diff --git a/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go b/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go index c79086778..41d10103a 100644 --- a/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go +++ b/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go @@ -40,9 +40,9 @@ func NewTestSuite(t *testing.T) *TestSuite { poolRewards: make(map[iotago.EpochIndex]map[string]*model.PoolRewards), epochStats: make(map[iotago.EpochIndex]*model.PoolsStats), api: iotago.V3API( - iotago.NewV3ProtocolParameters( + iotago.NewV3TestProtocolParameters( iotago.WithTimeProviderOptions(0, time.Now().Unix(), 10, 3), - iotago.WithRewardsOptions(8, 8, 11, 1154, 2, 1), + iotago.WithRewardsOptions(8, 8, 11, 2, 1), ), ), } diff --git a/pkg/storage/testframework_test.go b/pkg/storage/testframework_test.go index e3a98772e..896812abe 100644 --- a/pkg/storage/testframework_test.go +++ b/pkg/storage/testframework_test.go @@ -48,7 +48,7 @@ func NewTestFramework(t *testing.T, baseDir string, storageOpts ...options.Optio storageFactoryFunc := func() *storage.Storage { instance := storage.Create(baseDir, 0, errorHandler, storageOpts...) - require.NoError(t, instance.Settings().StoreProtocolParametersForStartEpoch(iotago.NewV3ProtocolParameters(), 0)) + require.NoError(t, instance.Settings().StoreProtocolParametersForStartEpoch(iotago.NewV3TestProtocolParameters(), 0)) return instance } diff --git a/pkg/tests/accounts_test.go b/pkg/tests/accounts_test.go index 39a6deb69..7df17b35e 100644 --- a/pkg/tests/accounts_test.go +++ b/pkg/tests/accounts_test.go @@ -26,14 +26,7 @@ func Test_TransitionAndDestroyAccount(t *testing.T) { 0, testsuite.GenesisTimeWithOffsetBySlots(200, testsuite.DefaultSlotDurationInSeconds), testsuite.DefaultSlotDurationInSeconds, - 8, - ), - iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, - testsuite.DefaultMinCommittableAge, - 100, - 120, + testsuite.DefaultSlotsPerEpochExponent, ), ), ) @@ -171,14 +164,7 @@ func Test_StakeDelegateAndDelayedClaim(t *testing.T) { 0, testsuite.GenesisTimeWithOffsetBySlots(100, testsuite.DefaultSlotDurationInSeconds), testsuite.DefaultSlotDurationInSeconds, - 8, - ), - iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, - testsuite.DefaultMinCommittableAge, - 100, - 120, + testsuite.DefaultSlotsPerEpochExponent, ), ), ) @@ -355,14 +341,7 @@ func Test_ImplicitAccounts(t *testing.T) { 0, testsuite.GenesisTimeWithOffsetBySlots(100, testsuite.DefaultSlotDurationInSeconds), testsuite.DefaultSlotDurationInSeconds, - 8, - ), - iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, - testsuite.DefaultMinCommittableAge, - 100, - 120, + testsuite.DefaultSlotsPerEpochExponent, ), ), ) @@ -483,14 +462,7 @@ func Test_NegativeBIC_BlockIssuerLocked(t *testing.T) { iotago.SlotIndex(0), testsuite.GenesisTimeWithOffsetBySlots(iotago.SlotIndex(200), testsuite.DefaultSlotDurationInSeconds), testsuite.DefaultSlotDurationInSeconds, - 8, - ), - iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, - testsuite.DefaultMinCommittableAge, - 100, - testsuite.DefaultEpochNearingThreshold, + testsuite.DefaultSlotsPerEpochExponent, ), ), ) @@ -681,14 +653,7 @@ func Test_NegativeBIC_AccountOutput(t *testing.T) { 0, testsuite.GenesisTimeWithOffsetBySlots(200, testsuite.DefaultSlotDurationInSeconds), testsuite.DefaultSlotDurationInSeconds, - 8, - ), - iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, - testsuite.DefaultMinCommittableAge, - 100, - testsuite.DefaultEpochNearingThreshold, + testsuite.DefaultSlotsPerEpochExponent, ), ), ) @@ -885,8 +850,8 @@ func Test_NegativeBIC_AccountOutput(t *testing.T) { // assert diff of the destroyed account. ts.AssertAccountDiff(wallet1.BlockIssuer.AccountID, block4Slot, &model.AccountDiff{ - BICChange: -iotago.BlockIssuanceCredits(9500), - PreviousUpdatedSlot: 21, + BICChange: -iotago.BlockIssuanceCredits(wallet1BIC), + PreviousUpdatedSlot: block3Slot, NewExpirySlot: 0, PreviousExpirySlot: newExpirySlot, NewOutputID: iotago.EmptyOutputID, @@ -908,14 +873,7 @@ func Test_NegativeBIC_AccountOwnedBasicOutputLocked(t *testing.T) { 0, testsuite.GenesisTimeWithOffsetBySlots(200, testsuite.DefaultSlotDurationInSeconds), testsuite.DefaultSlotDurationInSeconds, - 8, - ), - iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, - testsuite.DefaultMinCommittableAge, - 100, - testsuite.DefaultEpochNearingThreshold, + testsuite.DefaultSlotsPerEpochExponent, ), ), ) diff --git a/pkg/tests/booker_test.go b/pkg/tests/booker_test.go index abd3db23b..1bf08572b 100644 --- a/pkg/tests/booker_test.go +++ b/pkg/tests/booker_test.go @@ -327,8 +327,8 @@ func Test_SpendRejectedCommittedRace(t *testing.T) { testsuite.DefaultSlotsPerEpochExponent, ), iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, + 15, + 15, 2, 5, testsuite.DefaultEpochNearingThreshold, @@ -600,8 +600,8 @@ func Test_SpendPendingCommittedRace(t *testing.T) { testsuite.DefaultSlotsPerEpochExponent, ), iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, + 15, + 15, 2, 5, testsuite.DefaultEpochNearingThreshold, diff --git a/pkg/tests/reward_test.go b/pkg/tests/reward_test.go index 67af8e176..3f11112f0 100644 --- a/pkg/tests/reward_test.go +++ b/pkg/tests/reward_test.go @@ -22,13 +22,7 @@ func setupDelegationTestsuite(t *testing.T) (*testsuite.TestSuite, *mock.Node, * testsuite.DefaultSlotDurationInSeconds, 8, ), - iotago.WithLivenessOptions( - testsuite.DefaultLivenessThresholdLowerBoundInSeconds, - testsuite.DefaultLivenessThresholdUpperBoundInSeconds, - testsuite.DefaultMinCommittableAge, - 100, - 120, - ), + iotago.WithStakingOptions(2, 10, 10), ), ) diff --git a/pkg/tests/upgrade_signaling_test.go b/pkg/tests/upgrade_signaling_test.go index 0a627d5e1..0c1bf1822 100644 --- a/pkg/tests/upgrade_signaling_test.go +++ b/pkg/tests/upgrade_signaling_test.go @@ -50,7 +50,7 @@ func Test_Upgrade_Signaling(t *testing.T) { defer ts.Shutdown() // We "pretend" to have version 5 but reuse the same protocol parameters as for version 3. - v5ProtocolParameters := iotago.NewV3ProtocolParameters( + v5ProtocolParameters := iotago.NewV3TestProtocolParameters( append( ts.ProtocolParameterOptions, iotago.WithVersion(5), diff --git a/pkg/testsuite/depositcalculator/depositcalculator_test.go b/pkg/testsuite/depositcalculator/depositcalculator_test.go index 562e1831a..9f8af3051 100644 --- a/pkg/testsuite/depositcalculator/depositcalculator_test.go +++ b/pkg/testsuite/depositcalculator/depositcalculator_test.go @@ -13,7 +13,7 @@ import ( func TestCalculate(t *testing.T) { - protocolParams := iotago.NewV3ProtocolParameters(iotago.WithVersion(3)) + protocolParams := iotago.NewV3TestProtocolParameters(iotago.WithVersion(3)) storageScoreStructure := iotago.NewStorageScoreStructure(protocolParams.StorageScoreParameters()) type test struct { diff --git a/pkg/testsuite/testsuite.go b/pkg/testsuite/testsuite.go index 76d7ecc75..bb2eb3b19 100644 --- a/pkg/testsuite/testsuite.go +++ b/pkg/testsuite/testsuite.go @@ -29,50 +29,6 @@ import ( "github.com/iotaledger/iota.go/v4/wallet" ) -func DefaultProtocolParameterOptions(networkName string) []options.Option[iotago.V3ProtocolParameters] { - return []options.Option[iotago.V3ProtocolParameters]{ - iotago.WithNetworkOptions( - networkName, - "rms", - ), - iotago.WithSupplyOptions( - 1_000_0000, - 100, - 1, - 10, - 100, - 100, - 100, - ), - iotago.WithRewardsOptions(8, 8, 31, 1154, 2, 1), - iotago.WithStakingOptions(1, 100, 1), - - iotago.WithTimeProviderOptions( - 0, - GenesisTimeWithOffsetBySlots(0, DefaultSlotDurationInSeconds), - DefaultSlotDurationInSeconds, - DefaultSlotsPerEpochExponent, - ), - iotago.WithLivenessOptions( - DefaultLivenessThresholdLowerBoundInSeconds, - DefaultLivenessThresholdUpperBoundInSeconds, - DefaultMinCommittableAge, - DefaultMaxCommittableAge, - DefaultEpochNearingThreshold, - ), - iotago.WithCongestionControlOptions( - DefaultMinReferenceManaCost, - DefaultRMCIncrease, - DefaultRMCDecrease, - DefaultRMCIncreaseThreshold, - DefaultRMCDecreaseThreshold, - DefaultSchedulerRate, - DefaultMaxBufferSize, - DefaultMaxValBufferSize, - ), - } -} - type WalletOptions struct { Amount iotago.BaseToken BlockIssuanceCredits iotago.BlockIssuanceCredits @@ -136,8 +92,8 @@ func NewTestSuite(testingT *testing.T, opts ...options.Option[TestSuite]) *TestS }, opts, func(t *TestSuite) { fmt.Println("Setup TestSuite -", testingT.Name(), " @ ", time.Now()) - t.ProtocolParameterOptions = append(DefaultProtocolParameterOptions(testingT.Name()), t.ProtocolParameterOptions...) - t.API = iotago.V3API(iotago.NewV3ProtocolParameters(t.ProtocolParameterOptions...)) + t.ProtocolParameterOptions = append(t.ProtocolParameterOptions, iotago.WithNetworkOptions(testingT.Name())) + t.API = iotago.V3API(iotago.NewV3TestProtocolParameters(t.ProtocolParameterOptions...)) genesisBlock := blocks.NewRootBlock(t.API.ProtocolParameters().GenesisBlockID(), iotago.NewEmptyCommitment(t.API).MustID(), time.Unix(t.API.ProtocolParameters().GenesisUnixTimestamp(), 0)) t.RegisterBlock("Genesis", genesisBlock) diff --git a/pkg/testsuite/testsuite_options.go b/pkg/testsuite/testsuite_options.go index 0f3991013..03bd728d6 100644 --- a/pkg/testsuite/testsuite_options.go +++ b/pkg/testsuite/testsuite_options.go @@ -57,22 +57,23 @@ func durationFromEnvOrDefault(defaultDuration time.Duration, envKey string) time return d } -const ( - DefaultSlotDurationInSeconds uint8 = 10 - DefaultSlotsPerEpochExponent uint8 = 5 +var ( + defaultProtocolParams = iotago.NewV3TestProtocolParameters() + DefaultSlotDurationInSeconds uint8 = defaultProtocolParams.SlotDurationInSeconds() + DefaultSlotsPerEpochExponent uint8 = defaultProtocolParams.SlotsPerEpochExponent() - DefaultLivenessThresholdLowerBoundInSeconds uint16 = 30 - DefaultLivenessThresholdUpperBoundInSeconds uint16 = 30 - DefaultMinCommittableAge iotago.SlotIndex = 10 - DefaultMaxCommittableAge iotago.SlotIndex = 20 - DefaultEpochNearingThreshold iotago.SlotIndex = 24 + DefaultLivenessThresholdLowerBoundInSeconds uint16 = uint16(defaultProtocolParams.LivenessThresholdLowerBound().Seconds()) + DefaultLivenessThresholdUpperBoundInSeconds uint16 = uint16(defaultProtocolParams.LivenessThresholdUpperBound().Seconds()) + DefaultMinCommittableAge iotago.SlotIndex = defaultProtocolParams.MinCommittableAge() + DefaultMaxCommittableAge iotago.SlotIndex = defaultProtocolParams.MaxCommittableAge() + DefaultEpochNearingThreshold iotago.SlotIndex = defaultProtocolParams.EpochNearingThreshold() - DefaultMinReferenceManaCost iotago.Mana = 500 - DefaultRMCIncrease iotago.Mana = 500 - DefaultRMCDecrease iotago.Mana = 500 - DefaultRMCIncreaseThreshold iotago.WorkScore = 8 * DefaultSchedulerRate - DefaultRMCDecreaseThreshold iotago.WorkScore = 5 * DefaultSchedulerRate - DefaultSchedulerRate iotago.WorkScore = 100000 - DefaultMaxBufferSize uint32 = 100 * iotago.MaxBlockSize - DefaultMaxValBufferSize uint32 = 100 * iotago.MaxBlockSize + DefaultMinReferenceManaCost iotago.Mana = defaultProtocolParams.CongestionControlParameters().MinReferenceManaCost + DefaultRMCIncrease iotago.Mana = defaultProtocolParams.CongestionControlParameters().Increase + DefaultRMCDecrease iotago.Mana = defaultProtocolParams.CongestionControlParameters().Decrease + DefaultRMCIncreaseThreshold iotago.WorkScore = defaultProtocolParams.CongestionControlParameters().IncreaseThreshold + DefaultRMCDecreaseThreshold iotago.WorkScore = defaultProtocolParams.CongestionControlParameters().DecreaseThreshold + DefaultSchedulerRate iotago.WorkScore = defaultProtocolParams.CongestionControlParameters().SchedulerRate + DefaultMaxBufferSize uint32 = defaultProtocolParams.CongestionControlParameters().MaxBufferSize + DefaultMaxValBufferSize uint32 = defaultProtocolParams.CongestionControlParameters().MaxValidationBufferSize ) diff --git a/tools/gendoc/go.mod b/tools/gendoc/go.mod index ee1992d2c..cecc30daa 100644 --- a/tools/gendoc/go.mod +++ b/tools/gendoc/go.mod @@ -72,7 +72,7 @@ require ( github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe // indirect github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 // indirect github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 // indirect - github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6 // indirect + github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da // indirect github.com/ipfs/boxo v0.13.1 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect diff --git a/tools/gendoc/go.sum b/tools/gendoc/go.sum index 734814b2e..eecb77c05 100644 --- a/tools/gendoc/go.sum +++ b/tools/gendoc/go.sum @@ -311,8 +311,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozra github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665/go.mod h1:obK1N42oafGA7EH6zC4VX2fKh7jTa3WnIa9h1azfxq0= -github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6 h1:Wuf8Ps3tzuZ5CCbl7LA5O2qwhfuXWo30RCOT0yhm4pg= -github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da h1:oNgrEVzIa4613fN7Prw9RCePT1wIF5UB1MnhoV/ys4M= +github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/tools/genesis-snapshot/go.mod b/tools/genesis-snapshot/go.mod index 416b59558..4ae3b94fd 100644 --- a/tools/genesis-snapshot/go.mod +++ b/tools/genesis-snapshot/go.mod @@ -10,7 +10,7 @@ require ( github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 - github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6 + github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da github.com/mr-tron/base58 v1.2.0 github.com/spf13/pflag v1.0.5 golang.org/x/crypto v0.16.0 diff --git a/tools/genesis-snapshot/go.sum b/tools/genesis-snapshot/go.sum index 30c064306..172121c91 100644 --- a/tools/genesis-snapshot/go.sum +++ b/tools/genesis-snapshot/go.sum @@ -52,8 +52,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e3 github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe h1:RcFUqhnJ+86+sA0XMrZ0q+086ULrdWQkWrjUt2OnJK4= github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= -github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6 h1:Wuf8Ps3tzuZ5CCbl7LA5O2qwhfuXWo30RCOT0yhm4pg= -github.com/iotaledger/iota.go/v4 v4.0.0-20231204084048-9c12053adaf6/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da h1:oNgrEVzIa4613fN7Prw9RCePT1wIF5UB1MnhoV/ys4M= +github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= 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= diff --git a/tools/genesis-snapshot/presets/presets.go b/tools/genesis-snapshot/presets/presets.go index 208e15859..bfbd492a2 100644 --- a/tools/genesis-snapshot/presets/presets.go +++ b/tools/genesis-snapshot/presets/presets.go @@ -1,8 +1,6 @@ package presets import ( - "time" - "golang.org/x/crypto/blake2b" "github.com/iotaledger/hive.go/crypto/ed25519" @@ -16,34 +14,19 @@ import ( ) var ( - protocolParamsBase = iotago.NewV3ProtocolParameters( - iotago.WithNetworkOptions("default", "rms"), - iotago.WithSupplyOptions(4_600_000_000_000_000, 250, 1, 1000, 100000, 500000, 100000), - iotago.WithTimeProviderOptions(0, 1696841745, 10, 13), - iotago.WithLivenessOptions(30, 30, 7, 14, 30), - // increase/decrease threshold = fraction * slotDurationInSeconds * schedulerRate - iotago.WithCongestionControlOptions(500, 500, 500, 800000, 500000, 100000, 1000, 100), - iotago.WithWorkScoreOptions(25, 1, 100, 50, 10, 10, 50, 1, 10, 250), + // use defaults from iota.go + protocolParamsBase = iotago.NewV3TestProtocolParameters( + iotago.WithNetworkOptions("default"), ) - protocolParamsDocker = iotago.NewV3ProtocolParameters( - iotago.WithNetworkOptions("docker", "rms"), - iotago.WithSupplyOptions(4_600_000_000_000_000, 250, 1, 1000, 100000, 500000, 100000), - iotago.WithTimeProviderOptions(5, time.Now().Unix(), 10, 13), - iotago.WithLivenessOptions(30, 30, 7, 14, 30), - // increase/decrease threshold = fraction * slotDurationInSeconds * schedulerRate - iotago.WithCongestionControlOptions(500, 500, 500, 800000, 500000, 100000, 1000, 100), - iotago.WithWorkScoreOptions(25, 1, 100, 50, 10, 10, 50, 1, 10, 250), + // use defaults from iota.go + protocolParamsDocker = iotago.NewV3TestProtocolParameters( + iotago.WithNetworkOptions("docker"), ) - protocolParamsFeature = iotago.NewV3ProtocolParameters( - iotago.WithNetworkOptions("feature", "rms"), - iotago.WithSupplyOptions(4_600_000_000_000_000, 250, 1, 1000, 100000, 500000, 100000), - iotago.WithTimeProviderOptions(666666, time.Now().Unix()-100_000, 10, 13), // Let's fix genesis at 10_000 slots back. - iotago.WithLivenessOptions(30, 30, 10, 20, 30), - // increase/decrease threshold = fraction * slotDurationInSeconds * schedulerRate - iotago.WithCongestionControlOptions(500, 500, 500, 800000, 500000, 100000, 1000, 100), - iotago.WithWorkScoreOptions(25, 1, 100, 50, 10, 10, 50, 1, 10, 250), + // use defaults from iota.go + protocolParamsFeature = iotago.NewV3TestProtocolParameters( + iotago.WithNetworkOptions("feature"), ) ) From b41e6aee14dcaaff21720179c363891ff11b6155 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 5 Dec 2023 16:16:54 +0000 Subject: [PATCH 02/10] fix engine getter --- pkg/testsuite/accounts.go | 4 ++-- pkg/testsuite/mock/wallet_transactions.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/testsuite/accounts.go b/pkg/testsuite/accounts.go index 212a17899..d324e78d5 100644 --- a/pkg/testsuite/accounts.go +++ b/pkg/testsuite/accounts.go @@ -14,12 +14,12 @@ func (t *TestSuite) AssertAccountStake(accountID iotago.AccountID, validatorStak nodes ...*mock.Node) { for _, node := range nodes { t.Eventually(func() error { - actualAccountData, exists, err := node.Protocol.MainEngineInstance().Ledger.Account(accountID, node.Protocol.MainEngineInstance().SyncManager.LatestCommitment().Slot()) + actualAccountData, exists, err := node.Protocol.Engines.Main.Get().Ledger.Account(accountID, node.Protocol.Engines.Main.Get().SyncManager.LatestCommitment().Slot()) if err != nil { return ierrors.Wrap(err, "AssertAccountData: failed to load account data") } if !exists { - return ierrors.Errorf("AssertAccountData: %s: account %s does not exist with latest committed slot %d", node.Name, accountID, node.Protocol.MainEngineInstance().SyncManager.LatestCommitment().Slot()) + return ierrors.Errorf("AssertAccountData: %s: account %s does not exist with latest committed slot %d", node.Name, accountID, node.Protocol.Engines.Main.Get().SyncManager.LatestCommitment().Slot()) } if accountID != actualAccountData.ID { diff --git a/pkg/testsuite/mock/wallet_transactions.go b/pkg/testsuite/mock/wallet_transactions.go index 76d48132d..911ba4622 100644 --- a/pkg/testsuite/mock/wallet_transactions.go +++ b/pkg/testsuite/mock/wallet_transactions.go @@ -101,7 +101,7 @@ func (w *Wallet) CreateDelegationFromInput(transactionName string, inputName str } func (w *Wallet) DelegationStartFromSlot(slot iotago.SlotIndex) iotago.EpochIndex { - latestCommitment := w.Node.Protocol.MainEngineInstance().Storage.Settings().LatestCommitment() + latestCommitment := w.Node.Protocol.Engines.Main.Get().Storage.Settings().LatestCommitment() apiForSlot := w.Node.Protocol.APIForSlot(slot) pastBoundedSlotIndex := latestCommitment.Slot() + apiForSlot.ProtocolParameters().MaxCommittableAge() @@ -117,7 +117,7 @@ func (w *Wallet) DelegationStartFromSlot(slot iotago.SlotIndex) iotago.EpochInde } func (w *Wallet) DelegationEndFromSlot(slot iotago.SlotIndex) iotago.EpochIndex { - latestCommitment := w.Node.Protocol.MainEngineInstance().Storage.Settings().LatestCommitment() + latestCommitment := w.Node.Protocol.Engines.Main.Get().Storage.Settings().LatestCommitment() apiForSlot := w.Node.Protocol.APIForSlot(slot) futureBoundedSlotIndex := latestCommitment.Slot() + apiForSlot.ProtocolParameters().MinCommittableAge() From 7dfdd64e1b5cbf91baee168904218da3ae844571 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 5 Dec 2023 16:35:03 +0000 Subject: [PATCH 03/10] go mod tidy --- go.sum | 56 +++++++++++++++++------------------ tools/gendoc/go.mod | 32 +++++++++----------- tools/gendoc/go.sum | 56 +++++++++++++++++------------------ tools/genesis-snapshot/go.mod | 24 +++++++-------- tools/genesis-snapshot/go.sum | 48 +++++++++++++++--------------- 5 files changed, 106 insertions(+), 110 deletions(-) diff --git a/go.sum b/go.sum index 4fb7e6fa3..0dfb50318 100644 --- a/go.sum +++ b/go.sum @@ -275,34 +275,34 @@ github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJ github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys= github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw= -github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2 h1:0FynHsnJTZgxQuXk3/maXNgzyvbwQ+TnuiwY48kYSr4= -github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= -github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2 h1:WI6MQCxeANDyO7fOTovefuIusma+wT8VUJ3BisQLZEA= -github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:+riYmeLApkLlj4+EpuJpEJAsj/KGfD7cqLGy7oTsPOM= -github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe h1:vgJj9kXM1IkLjbjWOV565Vil+RlzJwVhxG/KebMmrKE= -github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2 h1:ZL4cGO4zy7IwCIfHQgpvu3yMbNnFFRvSvTqaZM5Uj5U= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= -github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe h1:/+Qw7fe5oSE5Jxm8RPzcfBKHbwjJ/zwHu3UWdSOvKW8= -github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= -github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2 h1:8YQlcFMexyYvjh3V/YSYzldeYjaDZd+1mHt8SUh8Uqs= -github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe h1:kVkjbdBANpA8tyu9RM4/GeyVoyRfGcb4LT96PqHTIWc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2 h1:b+AHpClIb7YAjpXgRHCsr+DRdBMuN4Q6k/wpFmT1wok= -github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= -github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe h1:dQBQ+ZOVwC6KJxTABHMMHjJto70gNU5Cn4dXeJp5xmM= -github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= -github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2 h1:3B6UFIJ+IJEiGmUbLt5+Zokv0i8RUs70IuSR9sB60DA= -github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= -github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2 h1:1r4fY+R9p2q5CzEkiXMuFr/UCM8RX3yPUllXkjm5/Fk= -github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:w1psHM2MuKsen1WdsPKrpqElYH7ZOQ+YdQIgJZg4HTo= -github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe h1:jewR0RJ7oTGWjzhTROdIwhMeBH4//frUHizKs/6Em+s= -github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2 h1:vTx/tPH+//CQcDjdC8DZv3s6x9KCqAfTqn3VTjYUUlw= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= -github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe h1:RcFUqhnJ+86+sA0XMrZ0q+086ULrdWQkWrjUt2OnJK4= -github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 h1:jxoBAPgC4I73pAwvEWI2IUCxiI1xN68IaFZ5WC1D3ek= +github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= +github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39 h1:B+SzeGOUyIROHfGjoYLJRPT/GL2u2X8pe3bS5avBbZc= +github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39/go.mod h1:+riYmeLApkLlj4+EpuJpEJAsj/KGfD7cqLGy7oTsPOM= +github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 h1:zv6hp2CsJikP2jdkOjngJmpUVjhC2UfiIFN6yGvo4jA= +github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 h1:qAIj5vpAojkrORpOflrUYJ6iFL4osUkyP6Vr7/WK9BI= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= +github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 h1:5lXV8tI2PlMWraa9eT5xGasNdiMaAYd1159mzXdX1xM= +github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= +github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 h1:axE2+FtJQpAQ40KerOISEzHndqv79h7zYs8NZ7r0jNQ= +github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 h1:KpHT3dYj+WoFnAzkW4EPluWHuhzErTree0+AF/KVBTU= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 h1:Gp2h+Els9cTVYYnYsHX3zLuixb0XggIj2okK570aKww= +github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= +github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 h1:Di2G2i/hGyhe3D8j/MsnZqnx1yJBiMdbXDIrtbWpe8g= +github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= +github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 h1:kYj16hPQ0iH+1srDaIj4wZCGH5qrhsFpHkLbh3Ob1Bs= +github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= +github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39 h1:m4b7gNQu1HI+LH1m0oAvuFnpp7/EC/iPGHK7ImWNk3w= +github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39/go.mod h1:w1psHM2MuKsen1WdsPKrpqElYH7ZOQ+YdQIgJZg4HTo= +github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 h1:O6tJNVV544ts/DKIIfHQJNGXIPZgntR1DJ4e+jPR9rQ= +github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 h1:GPa5qfHm59jqY3pff0eCnt/mpWFm6fibVK/n/E+Pfyk= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= +github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 h1:gatLNIqLC/MAR5qlj+413/y0LmyfKC0QL2BKXLniD0M= +github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozrau44uPy2kYv2fuj2Wks8+VkXR62WB9zONOJgzdE= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= diff --git a/tools/gendoc/go.mod b/tools/gendoc/go.mod index cecc30daa..8568863ed 100644 --- a/tools/gendoc/go.mod +++ b/tools/gendoc/go.mod @@ -5,7 +5,7 @@ go 1.21 replace github.com/iotaledger/iota-core => ../../ require ( - github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2 + github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39 github.com/iotaledger/hive.go/apputils v0.0.0-20230829152614-7afc7a4d89b3 github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 ) @@ -18,7 +18,6 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/docker/go-units v0.5.0 // indirect @@ -57,19 +56,19 @@ require ( github.com/huin/goupnp v1.3.0 // indirect github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 // indirect - github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe // indirect - github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe // indirect - github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe // indirect - github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe // indirect + github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 // indirect github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 // indirect github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 // indirect github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da // indirect @@ -134,7 +133,6 @@ require ( github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pokt-network/smt v0.6.1 // indirect github.com/polydawn/refmt v0.89.0 // indirect github.com/prometheus/client_golang v1.17.0 // indirect @@ -150,7 +148,6 @@ require ( github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.4 // indirect github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect @@ -182,6 +179,5 @@ require ( google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.2.1 // indirect ) diff --git a/tools/gendoc/go.sum b/tools/gendoc/go.sum index eecb77c05..11602051c 100644 --- a/tools/gendoc/go.sum +++ b/tools/gendoc/go.sum @@ -277,36 +277,36 @@ github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJ github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys= github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw= -github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2 h1:0FynHsnJTZgxQuXk3/maXNgzyvbwQ+TnuiwY48kYSr4= -github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= -github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2 h1:WI6MQCxeANDyO7fOTovefuIusma+wT8VUJ3BisQLZEA= -github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:+riYmeLApkLlj4+EpuJpEJAsj/KGfD7cqLGy7oTsPOM= +github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 h1:jxoBAPgC4I73pAwvEWI2IUCxiI1xN68IaFZ5WC1D3ek= +github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= +github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39 h1:B+SzeGOUyIROHfGjoYLJRPT/GL2u2X8pe3bS5avBbZc= +github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39/go.mod h1:+riYmeLApkLlj4+EpuJpEJAsj/KGfD7cqLGy7oTsPOM= github.com/iotaledger/hive.go/apputils v0.0.0-20230829152614-7afc7a4d89b3 h1:4aVJTc0KS77uEw0Tny4r0n1ORwcbAQDECaCclgf/6lE= github.com/iotaledger/hive.go/apputils v0.0.0-20230829152614-7afc7a4d89b3/go.mod h1:TZeAqieDu+xDOZp2e9+S+8pZp1PrfgcwLUnxmd8IgLU= -github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe h1:vgJj9kXM1IkLjbjWOV565Vil+RlzJwVhxG/KebMmrKE= -github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2 h1:ZL4cGO4zy7IwCIfHQgpvu3yMbNnFFRvSvTqaZM5Uj5U= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= -github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe h1:/+Qw7fe5oSE5Jxm8RPzcfBKHbwjJ/zwHu3UWdSOvKW8= -github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= -github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2 h1:8YQlcFMexyYvjh3V/YSYzldeYjaDZd+1mHt8SUh8Uqs= -github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe h1:kVkjbdBANpA8tyu9RM4/GeyVoyRfGcb4LT96PqHTIWc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2 h1:b+AHpClIb7YAjpXgRHCsr+DRdBMuN4Q6k/wpFmT1wok= -github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= -github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe h1:dQBQ+ZOVwC6KJxTABHMMHjJto70gNU5Cn4dXeJp5xmM= -github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= -github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2 h1:3B6UFIJ+IJEiGmUbLt5+Zokv0i8RUs70IuSR9sB60DA= -github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= -github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2 h1:1r4fY+R9p2q5CzEkiXMuFr/UCM8RX3yPUllXkjm5/Fk= -github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:w1psHM2MuKsen1WdsPKrpqElYH7ZOQ+YdQIgJZg4HTo= -github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe h1:jewR0RJ7oTGWjzhTROdIwhMeBH4//frUHizKs/6Em+s= -github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2 h1:vTx/tPH+//CQcDjdC8DZv3s6x9KCqAfTqn3VTjYUUlw= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= -github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe h1:RcFUqhnJ+86+sA0XMrZ0q+086ULrdWQkWrjUt2OnJK4= -github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 h1:zv6hp2CsJikP2jdkOjngJmpUVjhC2UfiIFN6yGvo4jA= +github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 h1:qAIj5vpAojkrORpOflrUYJ6iFL4osUkyP6Vr7/WK9BI= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= +github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 h1:5lXV8tI2PlMWraa9eT5xGasNdiMaAYd1159mzXdX1xM= +github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= +github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 h1:axE2+FtJQpAQ40KerOISEzHndqv79h7zYs8NZ7r0jNQ= +github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 h1:KpHT3dYj+WoFnAzkW4EPluWHuhzErTree0+AF/KVBTU= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 h1:Gp2h+Els9cTVYYnYsHX3zLuixb0XggIj2okK570aKww= +github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= +github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 h1:Di2G2i/hGyhe3D8j/MsnZqnx1yJBiMdbXDIrtbWpe8g= +github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= +github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 h1:kYj16hPQ0iH+1srDaIj4wZCGH5qrhsFpHkLbh3Ob1Bs= +github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= +github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39 h1:m4b7gNQu1HI+LH1m0oAvuFnpp7/EC/iPGHK7ImWNk3w= +github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39/go.mod h1:w1psHM2MuKsen1WdsPKrpqElYH7ZOQ+YdQIgJZg4HTo= +github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 h1:O6tJNVV544ts/DKIIfHQJNGXIPZgntR1DJ4e+jPR9rQ= +github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 h1:GPa5qfHm59jqY3pff0eCnt/mpWFm6fibVK/n/E+Pfyk= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= +github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 h1:gatLNIqLC/MAR5qlj+413/y0LmyfKC0QL2BKXLniD0M= +github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozrau44uPy2kYv2fuj2Wks8+VkXR62WB9zONOJgzdE= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= diff --git a/tools/genesis-snapshot/go.mod b/tools/genesis-snapshot/go.mod index 4ae3b94fd..9b0f259af 100644 --- a/tools/genesis-snapshot/go.mod +++ b/tools/genesis-snapshot/go.mod @@ -5,10 +5,10 @@ go 1.21 replace github.com/iotaledger/iota-core => ../../ require ( - github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe - github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe - github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe - github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe + github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 + github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 + github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 + github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da github.com/mr-tron/base58 v1.2.0 @@ -26,14 +26,14 @@ require ( github.com/holiman/uint256 v1.2.4 // indirect github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 // indirect - github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe // indirect + github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/text v0.2.0 // indirect diff --git a/tools/genesis-snapshot/go.sum b/tools/genesis-snapshot/go.sum index 172121c91..16ec77a10 100644 --- a/tools/genesis-snapshot/go.sum +++ b/tools/genesis-snapshot/go.sum @@ -28,30 +28,30 @@ github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJ github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys= github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw= -github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2 h1:0FynHsnJTZgxQuXk3/maXNgzyvbwQ+TnuiwY48kYSr4= -github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= -github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe h1:vgJj9kXM1IkLjbjWOV565Vil+RlzJwVhxG/KebMmrKE= -github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2 h1:ZL4cGO4zy7IwCIfHQgpvu3yMbNnFFRvSvTqaZM5Uj5U= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= -github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe h1:/+Qw7fe5oSE5Jxm8RPzcfBKHbwjJ/zwHu3UWdSOvKW8= -github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= -github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2 h1:8YQlcFMexyYvjh3V/YSYzldeYjaDZd+1mHt8SUh8Uqs= -github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe h1:kVkjbdBANpA8tyu9RM4/GeyVoyRfGcb4LT96PqHTIWc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2 h1:b+AHpClIb7YAjpXgRHCsr+DRdBMuN4Q6k/wpFmT1wok= -github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= -github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe h1:dQBQ+ZOVwC6KJxTABHMMHjJto70gNU5Cn4dXeJp5xmM= -github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= -github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2 h1:3B6UFIJ+IJEiGmUbLt5+Zokv0i8RUs70IuSR9sB60DA= -github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= -github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe h1:jewR0RJ7oTGWjzhTROdIwhMeBH4//frUHizKs/6Em+s= -github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2 h1:vTx/tPH+//CQcDjdC8DZv3s6x9KCqAfTqn3VTjYUUlw= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= -github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe h1:RcFUqhnJ+86+sA0XMrZ0q+086ULrdWQkWrjUt2OnJK4= -github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 h1:jxoBAPgC4I73pAwvEWI2IUCxiI1xN68IaFZ5WC1D3ek= +github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= +github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 h1:zv6hp2CsJikP2jdkOjngJmpUVjhC2UfiIFN6yGvo4jA= +github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 h1:qAIj5vpAojkrORpOflrUYJ6iFL4osUkyP6Vr7/WK9BI= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= +github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 h1:5lXV8tI2PlMWraa9eT5xGasNdiMaAYd1159mzXdX1xM= +github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= +github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 h1:axE2+FtJQpAQ40KerOISEzHndqv79h7zYs8NZ7r0jNQ= +github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 h1:KpHT3dYj+WoFnAzkW4EPluWHuhzErTree0+AF/KVBTU= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 h1:Gp2h+Els9cTVYYnYsHX3zLuixb0XggIj2okK570aKww= +github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= +github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 h1:Di2G2i/hGyhe3D8j/MsnZqnx1yJBiMdbXDIrtbWpe8g= +github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= +github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 h1:kYj16hPQ0iH+1srDaIj4wZCGH5qrhsFpHkLbh3Ob1Bs= +github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= +github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 h1:O6tJNVV544ts/DKIIfHQJNGXIPZgntR1DJ4e+jPR9rQ= +github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 h1:GPa5qfHm59jqY3pff0eCnt/mpWFm6fibVK/n/E+Pfyk= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= +github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 h1:gatLNIqLC/MAR5qlj+413/y0LmyfKC0QL2BKXLniD0M= +github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da h1:oNgrEVzIa4613fN7Prw9RCePT1wIF5UB1MnhoV/ys4M= github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= From 49a50ea4a9b27010a56e2255021dc2a76bd06e21 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Dec 2023 09:04:05 +0000 Subject: [PATCH 04/10] fix insane parameters --- .../attestation/slotattestation/testframework_test.go | 6 +++++- .../seatmanager/topstakers/topstakers_test.go | 1 - .../sybilprotectionv1/performance/testsuite_test.go | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/protocol/engine/attestation/slotattestation/testframework_test.go b/pkg/protocol/engine/attestation/slotattestation/testframework_test.go index 624158d66..f99a5344f 100644 --- a/pkg/protocol/engine/attestation/slotattestation/testframework_test.go +++ b/pkg/protocol/engine/attestation/slotattestation/testframework_test.go @@ -69,7 +69,11 @@ func NewTestFramework(test *testing.T) *TestFramework { return accounts.SelectCommittee(members...), true } - t.testAPI = iotago.V3API(iotago.NewV3TestProtocolParameters()) + t.testAPI = iotago.V3API( + iotago.NewV3TestProtocolParameters( + iotago.WithLivenessOptions(5, 5, 1, 2, 8), + ), + ) t.apiProvider = iotago.SingleVersionProvider(t.testAPI) diff --git a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go index 317a1e824..43b53a0c2 100644 --- a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go +++ b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go @@ -23,7 +23,6 @@ import ( func TestTopStakers_InitializeCommittee(t *testing.T) { var testAPI = iotago.V3API( iotago.NewV3TestProtocolParameters( - iotago.WithSupplyOptions(2_779_530_283_277_761, 0, 0, 0, 0, 0, 0), iotago.WithWorkScoreOptions(0, 1, 0, 0, 0, 0, 0, 0, 0, 0), // all zero except block offset gives all blocks workscore = 1 iotago.WithTargetCommitteeSize(3), ), diff --git a/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go b/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go index 4e495332e..ab1150c36 100644 --- a/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go +++ b/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go @@ -42,6 +42,7 @@ func NewTestSuite(t *testing.T) *TestSuite { api: iotago.V3API( iotago.NewV3TestProtocolParameters( iotago.WithTimeProviderOptions(0, time.Now().Unix(), 10, 3), + iotago.WithLivenessOptions(5, 5, 1, 2, 3), iotago.WithRewardsOptions(8, 8, 11, 2, 1), ), ), From b3974dcf582bdfed0596ad5b0459368f47d8ae86 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Dec 2023 09:53:42 +0000 Subject: [PATCH 05/10] fix tests --- go.mod | 2 +- go.sum | 4 ++-- .../sybilprotection/seatmanager/topstakers/topstakers_test.go | 1 - tools/gendoc/go.mod | 2 +- tools/gendoc/go.sum | 4 ++-- tools/genesis-snapshot/go.mod | 2 +- tools/genesis-snapshot/go.sum | 4 ++-- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 15f0699a3..4612fa2fd 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 - github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da + github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 github.com/labstack/echo/v4 v4.11.3 github.com/labstack/gommon v0.4.1 github.com/libp2p/go-libp2p v0.32.0 diff --git a/go.sum b/go.sum index 0dfb50318..c9c58caa2 100644 --- a/go.sum +++ b/go.sum @@ -307,8 +307,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozra github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665/go.mod h1:obK1N42oafGA7EH6zC4VX2fKh7jTa3WnIa9h1azfxq0= -github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da h1:oNgrEVzIa4613fN7Prw9RCePT1wIF5UB1MnhoV/ys4M= -github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 h1:qCXtPHNkshYFS9DJZEV0WeJEkN50syEuhFZobJjAIbw= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go index 43b53a0c2..247a23126 100644 --- a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go +++ b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go @@ -75,7 +75,6 @@ func TestTopStakers_InitializeCommittee(t *testing.T) { func TestTopStakers_RotateCommittee(t *testing.T) { var testAPI = iotago.V3API( iotago.NewV3TestProtocolParameters( - iotago.WithSupplyOptions(2_779_530_283_277_761, 0, 0, 0, 0, 0, 0), iotago.WithWorkScoreOptions(0, 1, 0, 0, 0, 0, 0, 0, 0, 0), // all zero except block offset gives all blocks workscore = 1 iotago.WithTargetCommitteeSize(10), ), diff --git a/tools/gendoc/go.mod b/tools/gendoc/go.mod index 8568863ed..4b18fa073 100644 --- a/tools/gendoc/go.mod +++ b/tools/gendoc/go.mod @@ -71,7 +71,7 @@ require ( github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 // indirect github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 // indirect github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 // indirect - github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da // indirect + github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 // indirect github.com/ipfs/boxo v0.13.1 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect diff --git a/tools/gendoc/go.sum b/tools/gendoc/go.sum index 11602051c..1de6c92f0 100644 --- a/tools/gendoc/go.sum +++ b/tools/gendoc/go.sum @@ -311,8 +311,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozra github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665/go.mod h1:obK1N42oafGA7EH6zC4VX2fKh7jTa3WnIa9h1azfxq0= -github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da h1:oNgrEVzIa4613fN7Prw9RCePT1wIF5UB1MnhoV/ys4M= -github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 h1:qCXtPHNkshYFS9DJZEV0WeJEkN50syEuhFZobJjAIbw= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/tools/genesis-snapshot/go.mod b/tools/genesis-snapshot/go.mod index 9b0f259af..89e6ab322 100644 --- a/tools/genesis-snapshot/go.mod +++ b/tools/genesis-snapshot/go.mod @@ -10,7 +10,7 @@ require ( github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 - github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da + github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 github.com/mr-tron/base58 v1.2.0 github.com/spf13/pflag v1.0.5 golang.org/x/crypto v0.16.0 diff --git a/tools/genesis-snapshot/go.sum b/tools/genesis-snapshot/go.sum index 16ec77a10..eadfe9072 100644 --- a/tools/genesis-snapshot/go.sum +++ b/tools/genesis-snapshot/go.sum @@ -52,8 +52,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-4723574 github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 h1:gatLNIqLC/MAR5qlj+413/y0LmyfKC0QL2BKXLniD0M= github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= -github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da h1:oNgrEVzIa4613fN7Prw9RCePT1wIF5UB1MnhoV/ys4M= -github.com/iotaledger/iota.go/v4 v4.0.0-20231205152647-c6d45e9076da/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 h1:qCXtPHNkshYFS9DJZEV0WeJEkN50syEuhFZobJjAIbw= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= 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= From f1ebea686091b1a58a47783deb911657db2637be Mon Sep 17 00:00:00 2001 From: muXxer Date: Wed, 6 Dec 2023 14:06:13 +0100 Subject: [PATCH 06/10] Add UTXOChangesFull endpoints --- components/restapi/core/commitment.go | 30 +++++++++++ components/restapi/core/component.go | 39 +++++++++++++++ go.mod | 36 +++++++------- go.sum | 72 +++++++++++++-------------- 4 files changed, 123 insertions(+), 54 deletions(-) diff --git a/components/restapi/core/commitment.go b/components/restapi/core/commitment.go index 7b9a1cd8d..12912f0d9 100644 --- a/components/restapi/core/commitment.go +++ b/components/restapi/core/commitment.go @@ -76,3 +76,33 @@ func getUTXOChanges(commitmentID iotago.CommitmentID) (*api.UTXOChangesResponse, ConsumedOutputs: consumedOutputs, }, nil } + +func getUTXOChangesFull(commitmentID iotago.CommitmentID) (*api.UTXOChangesFullResponse, error) { + diffs, err := deps.Protocol.Engines.Main.Get().Ledger.SlotDiffs(commitmentID.Slot()) + if err != nil { + return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to get slot diffs, commitmentID: %s, slot: %d, error: %w", commitmentID, commitmentID.Slot(), err) + } + + createdOutputs := make([]*api.OutputWithID, len(diffs.Outputs)) + consumedOutputs := make([]*api.OutputWithID, len(diffs.Spents)) + + for i, output := range diffs.Outputs { + createdOutputs[i] = &api.OutputWithID{ + OutputID: output.OutputID(), + Output: output.Output(), + } + } + + for i, output := range diffs.Spents { + consumedOutputs[i] = &api.OutputWithID{ + OutputID: output.OutputID(), + Output: output.Output().Output(), + } + } + + return &api.UTXOChangesFullResponse{ + CommitmentID: commitmentID, + CreatedOutputs: createdOutputs, + ConsumedOutputs: consumedOutputs, + }, nil +} diff --git a/components/restapi/core/component.go b/components/restapi/core/component.go index 603b0d375..cd6104963 100644 --- a/components/restapi/core/component.go +++ b/components/restapi/core/component.go @@ -142,6 +142,26 @@ func configure() error { return responseByHeader(c, resp) }) + routeGroup.GET(api.EndpointWithEchoParameters(api.CoreEndpointCommitmentByIDUTXOChangesFull), func(c echo.Context) error { + commitmentID, err := httpserver.ParseCommitmentIDParam(c, api.ParameterCommitmentID) + if err != nil { + return err + } + + // load the commitment to check if it matches the given commitmentID + commitment, err := getCommitmentByID(commitmentID) + if err != nil { + return err + } + + resp, err := getUTXOChangesFull(commitment.ID()) + if err != nil { + return err + } + + return responseByHeader(c, resp) + }) + routeGroup.GET(api.EndpointWithEchoParameters(api.CoreEndpointCommitmentBySlot), func(c echo.Context) error { index, err := httpserver.ParseSlotParam(c, api.ParameterSlot) if err != nil { @@ -175,6 +195,25 @@ func configure() error { return responseByHeader(c, resp) }) + routeGroup.GET(api.EndpointWithEchoParameters(api.CoreEndpointCommitmentBySlotUTXOChangesFull), func(c echo.Context) error { + slot, err := httpserver.ParseSlotParam(c, api.ParameterSlot) + if err != nil { + return err + } + + commitment, err := getCommitmentBySlot(slot) + if err != nil { + return err + } + + resp, err := getUTXOChangesFull(commitment.ID()) + if err != nil { + return err + } + + return responseByHeader(c, resp) + }) + routeGroup.GET(api.EndpointWithEchoParameters(api.CoreEndpointOutput), func(c echo.Context) error { resp, err := outputByID(c) if err != nil { diff --git a/go.mod b/go.mod index 4612fa2fd..2295c1ea1 100644 --- a/go.mod +++ b/go.mod @@ -11,22 +11,22 @@ require ( github.com/gorilla/websocket v1.5.1 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 - github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 + github.com/iotaledger/hive.go/app v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 - github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 - github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 - github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 + github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c + github.com/iotaledger/hive.go/logger v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231206124511-b78dc962031f + github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231206124145-f773dfe3927e + github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5 github.com/labstack/echo/v4 v4.11.3 github.com/labstack/gommon v0.4.1 github.com/libp2p/go-libp2p v0.32.0 @@ -140,7 +140,7 @@ require ( github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pokt-network/smt v0.6.1 // indirect @@ -155,7 +155,7 @@ require ( github.com/raulk/go-watchdog v1.3.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect @@ -175,7 +175,7 @@ require ( golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.4.0 // indirect + golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.14.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect diff --git a/go.sum b/go.sum index c9c58caa2..ea71d4d30 100644 --- a/go.sum +++ b/go.sum @@ -277,38 +277,38 @@ github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PT github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw= github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 h1:jxoBAPgC4I73pAwvEWI2IUCxiI1xN68IaFZ5WC1D3ek= github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= -github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39 h1:B+SzeGOUyIROHfGjoYLJRPT/GL2u2X8pe3bS5avBbZc= -github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39/go.mod h1:+riYmeLApkLlj4+EpuJpEJAsj/KGfD7cqLGy7oTsPOM= -github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 h1:zv6hp2CsJikP2jdkOjngJmpUVjhC2UfiIFN6yGvo4jA= -github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 h1:qAIj5vpAojkrORpOflrUYJ6iFL4osUkyP6Vr7/WK9BI= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= -github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 h1:5lXV8tI2PlMWraa9eT5xGasNdiMaAYd1159mzXdX1xM= -github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= -github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 h1:axE2+FtJQpAQ40KerOISEzHndqv79h7zYs8NZ7r0jNQ= -github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 h1:KpHT3dYj+WoFnAzkW4EPluWHuhzErTree0+AF/KVBTU= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/app v0.0.0-20231206114953-6a65a82e30ad h1:v7dkbVLSsmzgOWT2vjvv1MdKQXvqFbvIkx8mvh6VK7g= +github.com/iotaledger/hive.go/app v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:hTHKGFbZnuiW8yEgDuuL7ZjQTCnl8bXyHLmj3LPa648= +github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad h1:4XL7IIvdsWHxSKQfU+sgq3H9egN54053LF9TwMfDcTg= +github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad h1:iNzb/Oy/nucIOXOzRcwSqqFsaeKwr2JZpZYSLp8xjlE= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad/go.mod h1:CO28KMA6Pp5LJPiigPQQ276zQofES+jMod08U5pyRFA= +github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad h1:pUL2UZbF4S8FIV7uKo9p+IGfZ658K1VNorQ6rzDMRvs= +github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:7vHoF//1Pt3nu0l8nDIw7bEgv2GfbL3kSgjp7Rdqhd4= +github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad h1:adLrD6dOEkM5Xdg6AOPt9/HYqy/pQ5FrprDpW4/VqUU= +github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:NmZRIoxtL6iQdVK6n5W+JOx58K/0Yn8k7WuSvpKPQ+M= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad h1:WDl58zJKHfwbzHs+ZB8Jq3YNgVQE5Neu2NeaX3FZuyU= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 h1:Gp2h+Els9cTVYYnYsHX3zLuixb0XggIj2okK570aKww= github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= -github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 h1:Di2G2i/hGyhe3D8j/MsnZqnx1yJBiMdbXDIrtbWpe8g= -github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= -github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 h1:kYj16hPQ0iH+1srDaIj4wZCGH5qrhsFpHkLbh3Ob1Bs= -github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= -github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39 h1:m4b7gNQu1HI+LH1m0oAvuFnpp7/EC/iPGHK7ImWNk3w= -github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39/go.mod h1:w1psHM2MuKsen1WdsPKrpqElYH7ZOQ+YdQIgJZg4HTo= -github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 h1:O6tJNVV544ts/DKIIfHQJNGXIPZgntR1DJ4e+jPR9rQ= -github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 h1:GPa5qfHm59jqY3pff0eCnt/mpWFm6fibVK/n/E+Pfyk= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= -github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 h1:gatLNIqLC/MAR5qlj+413/y0LmyfKC0QL2BKXLniD0M= -github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= -github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozrau44uPy2kYv2fuj2Wks8+VkXR62WB9zONOJgzdE= -github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= -github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= -github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665/go.mod h1:obK1N42oafGA7EH6zC4VX2fKh7jTa3WnIa9h1azfxq0= -github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 h1:qCXtPHNkshYFS9DJZEV0WeJEkN50syEuhFZobJjAIbw= -github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad h1:qpCsjw+InLL824QPu3lY/osck4DhucBKhCs5/E8OH+A= +github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:ETXGXymFyNcUq2t4I9e7ZK18f9bxUWYat4pjZ9W0rWc= +github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c h1:Ksts6VjPj9y0o2Nis+2tHtDGWITNJ4yju87ZlHLPuOo= +github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c/go.mod h1:Td3R6QmYw0svZI1GuZ/tN9s0VNaHassXSKLCc70aX9w= +github.com/iotaledger/hive.go/logger v0.0.0-20231206114953-6a65a82e30ad h1:fazCxogqOLDEPNDPWYDLTDpYmwgTJgIaC2Z6VN52S4M= +github.com/iotaledger/hive.go/logger v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:hVaVODS+Uik0obf3SVEHFQNruUko/uqIgD/GKwhn49M= +github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad h1:HpupWK8iqFt+Sdogkh2/N8ojalmevYy+FzhjOuy7Y7E= +github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:Z9NFsByMh1Kf98f3v3ifeZRycbS2db1hjswTQG1MxnE= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad h1:c8uwbBZDqpiCNN9/9Jji7Z4lL0GdVnORp8WMouiuknk= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= +github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad h1:VC3OgdSbyngY7/gxVj66fKd/nGmN6P0/myr348nx7vA= +github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231206124511-b78dc962031f h1:V68Ijq1A64gB9r0Rhc4ybLGH66rXqZ2Ly0L4uuaLrMg= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231206124511-b78dc962031f/go.mod h1:Dy3Gv4Dn1zufB177x6IXETP3zTeiWQ1+HMVQR0Bt/ew= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231206124145-f773dfe3927e h1:jbtiUlmTpTdGiRBW1pniPSqRcDMJaIW8fGS+uORryas= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231206124145-f773dfe3927e/go.mod h1:zEb9onVHnDUStl5SsFBj7H0HBKfIN0c/pUND8Llfqp8= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5 h1:0KgQFpVRnKd6CdCwXo3Kg/SL27xkeKh2SMoU5G1TkZk= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5/go.mod h1:tiswk1O1wSAi9GE6tD1j43+bLmWU9Je07aZLaJ0+Ha0= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= @@ -521,8 +521,8 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 h1:+qIP3OMrT7SN5kLnTcVEISPOMB/97RyAKTg1UWA738E= +github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -623,8 +623,8 @@ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:Udh github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -831,8 +831,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= -golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From d26a7fc0626c33e54626ac71b34e08bb516cc8b8 Mon Sep 17 00:00:00 2001 From: muXxer Date: Wed, 6 Dec 2023 14:16:05 +0100 Subject: [PATCH 07/10] Update inx-app and iota.go --- .../slotattestation/testframework_test.go | 2 +- .../pre_solid_block_filter_test.go | 8 +-- .../seatmanager/topstakers/topstakers_test.go | 4 +- .../performance/testsuite_test.go | 2 +- pkg/storage/testframework_test.go | 2 +- pkg/tests/upgrade_signaling_test.go | 2 +- .../depositcalculator_test.go | 2 +- pkg/testsuite/testsuite.go | 4 +- pkg/testsuite/testsuite_options.go | 2 +- tools/gendoc/go.mod | 36 +++++----- tools/gendoc/go.sum | 72 +++++++++---------- tools/genesis-snapshot/go.mod | 24 +++---- tools/genesis-snapshot/go.sum | 48 ++++++------- tools/genesis-snapshot/presets/presets.go | 12 ++-- 14 files changed, 110 insertions(+), 110 deletions(-) diff --git a/pkg/protocol/engine/attestation/slotattestation/testframework_test.go b/pkg/protocol/engine/attestation/slotattestation/testframework_test.go index f99a5344f..67e428c0d 100644 --- a/pkg/protocol/engine/attestation/slotattestation/testframework_test.go +++ b/pkg/protocol/engine/attestation/slotattestation/testframework_test.go @@ -70,7 +70,7 @@ func NewTestFramework(test *testing.T) *TestFramework { } t.testAPI = iotago.V3API( - iotago.NewV3TestProtocolParameters( + iotago.NewV3SnapshotProtocolParameters( iotago.WithLivenessOptions(5, 5, 1, 2, 8), ), ) diff --git a/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go b/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go index 8496ac6d6..b1e24307a 100644 --- a/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go +++ b/pkg/protocol/engine/filter/presolidfilter/presolidblockfilter/pre_solid_block_filter_test.go @@ -137,12 +137,12 @@ func TestFilter_ProtocolVersion(t *testing.T) { apiProvider := iotago.NewEpochBasedProvider( iotago.WithAPIForMissingVersionCallback( func(params iotago.ProtocolParameters) (iotago.API, error) { - return iotago.V3API(iotago.NewV3TestProtocolParameters(iotago.WithVersion(params.Version()))), nil + return iotago.V3API(iotago.NewV3SnapshotProtocolParameters(iotago.WithVersion(params.Version()))), nil }, ), ) - apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3TestProtocolParameters(iotago.WithVersion(3)), 0) - apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3TestProtocolParameters(iotago.WithVersion(4)), 3) + apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3SnapshotProtocolParameters(iotago.WithVersion(3)), 0) + apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3SnapshotProtocolParameters(iotago.WithVersion(4)), 3) timeProvider := apiProvider.CommittedAPI().TimeProvider() @@ -187,7 +187,7 @@ func TestFilter_ProtocolVersion(t *testing.T) { valid.Add("G") require.NoError(t, tf.IssueBlockAtSlotWithVersion("G", timeProvider.EpochStart(5)+5, 4, apiProvider)) - apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3TestProtocolParameters(iotago.WithVersion(5)), 10) + apiProvider.AddProtocolParametersAtEpoch(iotago.NewV3SnapshotProtocolParameters(iotago.WithVersion(5)), 10) valid.Add("H") require.NoError(t, tf.IssueBlockAtSlotWithVersion("H", timeProvider.EpochEnd(9), 4, apiProvider)) diff --git a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go index 247a23126..a45851b45 100644 --- a/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go +++ b/pkg/protocol/sybilprotection/seatmanager/topstakers/topstakers_test.go @@ -22,7 +22,7 @@ import ( func TestTopStakers_InitializeCommittee(t *testing.T) { var testAPI = iotago.V3API( - iotago.NewV3TestProtocolParameters( + iotago.NewV3SnapshotProtocolParameters( iotago.WithWorkScoreOptions(0, 1, 0, 0, 0, 0, 0, 0, 0, 0), // all zero except block offset gives all blocks workscore = 1 iotago.WithTargetCommitteeSize(3), ), @@ -74,7 +74,7 @@ func TestTopStakers_InitializeCommittee(t *testing.T) { func TestTopStakers_RotateCommittee(t *testing.T) { var testAPI = iotago.V3API( - iotago.NewV3TestProtocolParameters( + iotago.NewV3SnapshotProtocolParameters( iotago.WithWorkScoreOptions(0, 1, 0, 0, 0, 0, 0, 0, 0, 0), // all zero except block offset gives all blocks workscore = 1 iotago.WithTargetCommitteeSize(10), ), diff --git a/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go b/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go index ab1150c36..77c48a11c 100644 --- a/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go +++ b/pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go @@ -40,7 +40,7 @@ func NewTestSuite(t *testing.T) *TestSuite { poolRewards: make(map[iotago.EpochIndex]map[string]*model.PoolRewards), epochStats: make(map[iotago.EpochIndex]*model.PoolsStats), api: iotago.V3API( - iotago.NewV3TestProtocolParameters( + iotago.NewV3SnapshotProtocolParameters( iotago.WithTimeProviderOptions(0, time.Now().Unix(), 10, 3), iotago.WithLivenessOptions(5, 5, 1, 2, 3), iotago.WithRewardsOptions(8, 8, 11, 2, 1), diff --git a/pkg/storage/testframework_test.go b/pkg/storage/testframework_test.go index 896812abe..8495409bf 100644 --- a/pkg/storage/testframework_test.go +++ b/pkg/storage/testframework_test.go @@ -48,7 +48,7 @@ func NewTestFramework(t *testing.T, baseDir string, storageOpts ...options.Optio storageFactoryFunc := func() *storage.Storage { instance := storage.Create(baseDir, 0, errorHandler, storageOpts...) - require.NoError(t, instance.Settings().StoreProtocolParametersForStartEpoch(iotago.NewV3TestProtocolParameters(), 0)) + require.NoError(t, instance.Settings().StoreProtocolParametersForStartEpoch(iotago.NewV3SnapshotProtocolParameters(), 0)) return instance } diff --git a/pkg/tests/upgrade_signaling_test.go b/pkg/tests/upgrade_signaling_test.go index 23cca166f..a9d81f508 100644 --- a/pkg/tests/upgrade_signaling_test.go +++ b/pkg/tests/upgrade_signaling_test.go @@ -49,7 +49,7 @@ func Test_Upgrade_Signaling(t *testing.T) { defer ts.Shutdown() // We "pretend" to have version 5 but reuse the same protocol parameters as for version 3. - v5ProtocolParameters := iotago.NewV3TestProtocolParameters( + v5ProtocolParameters := iotago.NewV3SnapshotProtocolParameters( append( ts.ProtocolParameterOptions, iotago.WithVersion(5), diff --git a/pkg/testsuite/depositcalculator/depositcalculator_test.go b/pkg/testsuite/depositcalculator/depositcalculator_test.go index 9f8af3051..b93271fe3 100644 --- a/pkg/testsuite/depositcalculator/depositcalculator_test.go +++ b/pkg/testsuite/depositcalculator/depositcalculator_test.go @@ -13,7 +13,7 @@ import ( func TestCalculate(t *testing.T) { - protocolParams := iotago.NewV3TestProtocolParameters(iotago.WithVersion(3)) + protocolParams := iotago.NewV3SnapshotProtocolParameters(iotago.WithVersion(3)) storageScoreStructure := iotago.NewStorageScoreStructure(protocolParams.StorageScoreParameters()) type test struct { diff --git a/pkg/testsuite/testsuite.go b/pkg/testsuite/testsuite.go index 908b4d09b..ea2b2a315 100644 --- a/pkg/testsuite/testsuite.go +++ b/pkg/testsuite/testsuite.go @@ -97,8 +97,8 @@ func NewTestSuite(testingT *testing.T, opts ...options.Option[TestSuite]) *TestS }, opts, func(t *TestSuite) { fmt.Println("Setup TestSuite -", testingT.Name(), " @ ", time.Now()) - t.ProtocolParameterOptions = append(t.ProtocolParameterOptions, iotago.WithNetworkOptions(testingT.Name())) - t.API = iotago.V3API(iotago.NewV3TestProtocolParameters(t.ProtocolParameterOptions...)) + t.ProtocolParameterOptions = append(t.ProtocolParameterOptions, iotago.WithNetworkOptions(testingT.Name(), iotago.PrefixTestnet)) + t.API = iotago.V3API(iotago.NewV3SnapshotProtocolParameters(t.ProtocolParameterOptions...)) genesisBlock := blocks.NewRootBlock(t.API.ProtocolParameters().GenesisBlockID(), iotago.NewEmptyCommitment(t.API).MustID(), time.Unix(t.API.ProtocolParameters().GenesisUnixTimestamp(), 0)) t.RegisterBlock("Genesis", genesisBlock) diff --git a/pkg/testsuite/testsuite_options.go b/pkg/testsuite/testsuite_options.go index 9ed58d5dc..79b4398f3 100644 --- a/pkg/testsuite/testsuite_options.go +++ b/pkg/testsuite/testsuite_options.go @@ -65,7 +65,7 @@ func durationFromEnvOrDefault(defaultDuration time.Duration, envKey string) time } var ( - defaultProtocolParams = iotago.NewV3TestProtocolParameters() + defaultProtocolParams = iotago.NewV3SnapshotProtocolParameters() DefaultSlotDurationInSeconds uint8 = defaultProtocolParams.SlotDurationInSeconds() DefaultSlotsPerEpochExponent uint8 = defaultProtocolParams.SlotsPerEpochExponent() diff --git a/tools/gendoc/go.mod b/tools/gendoc/go.mod index 4b18fa073..13874cbf0 100644 --- a/tools/gendoc/go.mod +++ b/tools/gendoc/go.mod @@ -5,7 +5,7 @@ go 1.21 replace github.com/iotaledger/iota-core => ../../ require ( - github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39 + github.com/iotaledger/hive.go/app v0.0.0-20231206114953-6a65a82e30ad github.com/iotaledger/hive.go/apputils v0.0.0-20230829152614-7afc7a4d89b3 github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 ) @@ -57,21 +57,21 @@ require ( github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 // indirect github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad // indirect github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 // indirect - github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 // indirect - github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 // indirect + github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c // indirect + github.com/iotaledger/hive.go/logger v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231206124511-b78dc962031f // indirect + github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231206124145-f773dfe3927e // indirect + github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5 // indirect github.com/ipfs/boxo v0.13.1 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect @@ -131,7 +131,7 @@ require ( github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pokt-network/smt v0.6.1 // indirect github.com/polydawn/refmt v0.89.0 // indirect @@ -146,7 +146,7 @@ require ( github.com/raulk/go-watchdog v1.3.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect @@ -172,7 +172,7 @@ require ( golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.4.0 // indirect + golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.14.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect diff --git a/tools/gendoc/go.sum b/tools/gendoc/go.sum index 1de6c92f0..3d2ccafdd 100644 --- a/tools/gendoc/go.sum +++ b/tools/gendoc/go.sum @@ -279,40 +279,40 @@ github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PT github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw= github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 h1:jxoBAPgC4I73pAwvEWI2IUCxiI1xN68IaFZ5WC1D3ek= github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= -github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39 h1:B+SzeGOUyIROHfGjoYLJRPT/GL2u2X8pe3bS5avBbZc= -github.com/iotaledger/hive.go/app v0.0.0-20231205131244-472357435a39/go.mod h1:+riYmeLApkLlj4+EpuJpEJAsj/KGfD7cqLGy7oTsPOM= +github.com/iotaledger/hive.go/app v0.0.0-20231206114953-6a65a82e30ad h1:v7dkbVLSsmzgOWT2vjvv1MdKQXvqFbvIkx8mvh6VK7g= +github.com/iotaledger/hive.go/app v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:hTHKGFbZnuiW8yEgDuuL7ZjQTCnl8bXyHLmj3LPa648= github.com/iotaledger/hive.go/apputils v0.0.0-20230829152614-7afc7a4d89b3 h1:4aVJTc0KS77uEw0Tny4r0n1ORwcbAQDECaCclgf/6lE= github.com/iotaledger/hive.go/apputils v0.0.0-20230829152614-7afc7a4d89b3/go.mod h1:TZeAqieDu+xDOZp2e9+S+8pZp1PrfgcwLUnxmd8IgLU= -github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 h1:zv6hp2CsJikP2jdkOjngJmpUVjhC2UfiIFN6yGvo4jA= -github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 h1:qAIj5vpAojkrORpOflrUYJ6iFL4osUkyP6Vr7/WK9BI= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= -github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 h1:5lXV8tI2PlMWraa9eT5xGasNdiMaAYd1159mzXdX1xM= -github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= -github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 h1:axE2+FtJQpAQ40KerOISEzHndqv79h7zYs8NZ7r0jNQ= -github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 h1:KpHT3dYj+WoFnAzkW4EPluWHuhzErTree0+AF/KVBTU= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad h1:4XL7IIvdsWHxSKQfU+sgq3H9egN54053LF9TwMfDcTg= +github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad h1:iNzb/Oy/nucIOXOzRcwSqqFsaeKwr2JZpZYSLp8xjlE= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad/go.mod h1:CO28KMA6Pp5LJPiigPQQ276zQofES+jMod08U5pyRFA= +github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad h1:pUL2UZbF4S8FIV7uKo9p+IGfZ658K1VNorQ6rzDMRvs= +github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:7vHoF//1Pt3nu0l8nDIw7bEgv2GfbL3kSgjp7Rdqhd4= +github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad h1:adLrD6dOEkM5Xdg6AOPt9/HYqy/pQ5FrprDpW4/VqUU= +github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:NmZRIoxtL6iQdVK6n5W+JOx58K/0Yn8k7WuSvpKPQ+M= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad h1:WDl58zJKHfwbzHs+ZB8Jq3YNgVQE5Neu2NeaX3FZuyU= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 h1:Gp2h+Els9cTVYYnYsHX3zLuixb0XggIj2okK570aKww= github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= -github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 h1:Di2G2i/hGyhe3D8j/MsnZqnx1yJBiMdbXDIrtbWpe8g= -github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= -github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 h1:kYj16hPQ0iH+1srDaIj4wZCGH5qrhsFpHkLbh3Ob1Bs= -github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= -github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39 h1:m4b7gNQu1HI+LH1m0oAvuFnpp7/EC/iPGHK7ImWNk3w= -github.com/iotaledger/hive.go/logger v0.0.0-20231205131244-472357435a39/go.mod h1:w1psHM2MuKsen1WdsPKrpqElYH7ZOQ+YdQIgJZg4HTo= -github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 h1:O6tJNVV544ts/DKIIfHQJNGXIPZgntR1DJ4e+jPR9rQ= -github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 h1:GPa5qfHm59jqY3pff0eCnt/mpWFm6fibVK/n/E+Pfyk= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= -github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 h1:gatLNIqLC/MAR5qlj+413/y0LmyfKC0QL2BKXLniD0M= -github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= -github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221 h1:+ozrau44uPy2kYv2fuj2Wks8+VkXR62WB9zONOJgzdE= -github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231201123347-1c44b3f24221/go.mod h1:6cLX3gnhP0WL+Q+mf3/rIqfACe5fWKVR8luPXWh2xiY= -github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665 h1:XdhojOpZ0t0pJFyNO0zlBogSAUrhEI67eCpTC9H6sGM= -github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231201114846-3bb5c3fd5665/go.mod h1:obK1N42oafGA7EH6zC4VX2fKh7jTa3WnIa9h1azfxq0= -github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 h1:qCXtPHNkshYFS9DJZEV0WeJEkN50syEuhFZobJjAIbw= -github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad h1:qpCsjw+InLL824QPu3lY/osck4DhucBKhCs5/E8OH+A= +github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:ETXGXymFyNcUq2t4I9e7ZK18f9bxUWYat4pjZ9W0rWc= +github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c h1:Ksts6VjPj9y0o2Nis+2tHtDGWITNJ4yju87ZlHLPuOo= +github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c/go.mod h1:Td3R6QmYw0svZI1GuZ/tN9s0VNaHassXSKLCc70aX9w= +github.com/iotaledger/hive.go/logger v0.0.0-20231206114953-6a65a82e30ad h1:fazCxogqOLDEPNDPWYDLTDpYmwgTJgIaC2Z6VN52S4M= +github.com/iotaledger/hive.go/logger v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:hVaVODS+Uik0obf3SVEHFQNruUko/uqIgD/GKwhn49M= +github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad h1:HpupWK8iqFt+Sdogkh2/N8ojalmevYy+FzhjOuy7Y7E= +github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:Z9NFsByMh1Kf98f3v3ifeZRycbS2db1hjswTQG1MxnE= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad h1:c8uwbBZDqpiCNN9/9Jji7Z4lL0GdVnORp8WMouiuknk= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= +github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad h1:VC3OgdSbyngY7/gxVj66fKd/nGmN6P0/myr348nx7vA= +github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231206124511-b78dc962031f h1:V68Ijq1A64gB9r0Rhc4ybLGH66rXqZ2Ly0L4uuaLrMg= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231206124511-b78dc962031f/go.mod h1:Dy3Gv4Dn1zufB177x6IXETP3zTeiWQ1+HMVQR0Bt/ew= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231206124145-f773dfe3927e h1:jbtiUlmTpTdGiRBW1pniPSqRcDMJaIW8fGS+uORryas= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231206124145-f773dfe3927e/go.mod h1:zEb9onVHnDUStl5SsFBj7H0HBKfIN0c/pUND8Llfqp8= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5 h1:0KgQFpVRnKd6CdCwXo3Kg/SL27xkeKh2SMoU5G1TkZk= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5/go.mod h1:tiswk1O1wSAi9GE6tD1j43+bLmWU9Je07aZLaJ0+Ha0= github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI= github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= @@ -525,8 +525,8 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 h1:+qIP3OMrT7SN5kLnTcVEISPOMB/97RyAKTg1UWA738E= +github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -627,8 +627,8 @@ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:Udh github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -835,8 +835,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= -golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/tools/genesis-snapshot/go.mod b/tools/genesis-snapshot/go.mod index 89e6ab322..756d9ce51 100644 --- a/tools/genesis-snapshot/go.mod +++ b/tools/genesis-snapshot/go.mod @@ -5,12 +5,12 @@ go 1.21 replace github.com/iotaledger/iota-core => ../../ require ( - github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 - github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 + github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad + github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 - github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 + github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5 github.com/mr-tron/base58 v1.2.0 github.com/spf13/pflag v1.0.5 golang.org/x/crypto v0.16.0 @@ -27,13 +27,13 @@ require ( github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 // indirect github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad // indirect github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 // indirect + github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad // indirect + github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/text v0.2.0 // indirect @@ -50,7 +50,7 @@ require ( github.com/otiai10/copy v1.14.0 // indirect github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pokt-network/smt v0.6.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect diff --git a/tools/genesis-snapshot/go.sum b/tools/genesis-snapshot/go.sum index eadfe9072..578c00428 100644 --- a/tools/genesis-snapshot/go.sum +++ b/tools/genesis-snapshot/go.sum @@ -30,30 +30,30 @@ github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PT github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw= github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39 h1:jxoBAPgC4I73pAwvEWI2IUCxiI1xN68IaFZ5WC1D3ek= github.com/iotaledger/hive.go/ads v0.0.0-20231205131244-472357435a39/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg= -github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39 h1:zv6hp2CsJikP2jdkOjngJmpUVjhC2UfiIFN6yGvo4jA= -github.com/iotaledger/hive.go/constraints v0.0.0-20231205131244-472357435a39/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39 h1:qAIj5vpAojkrORpOflrUYJ6iFL4osUkyP6Vr7/WK9BI= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231205131244-472357435a39/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko= -github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39 h1:5lXV8tI2PlMWraa9eT5xGasNdiMaAYd1159mzXdX1xM= -github.com/iotaledger/hive.go/crypto v0.0.0-20231205131244-472357435a39/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI= -github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39 h1:axE2+FtJQpAQ40KerOISEzHndqv79h7zYs8NZ7r0jNQ= -github.com/iotaledger/hive.go/ds v0.0.0-20231205131244-472357435a39/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39 h1:KpHT3dYj+WoFnAzkW4EPluWHuhzErTree0+AF/KVBTU= -github.com/iotaledger/hive.go/ierrors v0.0.0-20231205131244-472357435a39/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad h1:4XL7IIvdsWHxSKQfU+sgq3H9egN54053LF9TwMfDcTg= +github.com/iotaledger/hive.go/constraints v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad h1:iNzb/Oy/nucIOXOzRcwSqqFsaeKwr2JZpZYSLp8xjlE= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231206114953-6a65a82e30ad/go.mod h1:CO28KMA6Pp5LJPiigPQQ276zQofES+jMod08U5pyRFA= +github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad h1:pUL2UZbF4S8FIV7uKo9p+IGfZ658K1VNorQ6rzDMRvs= +github.com/iotaledger/hive.go/crypto v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:7vHoF//1Pt3nu0l8nDIw7bEgv2GfbL3kSgjp7Rdqhd4= +github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad h1:adLrD6dOEkM5Xdg6AOPt9/HYqy/pQ5FrprDpW4/VqUU= +github.com/iotaledger/hive.go/ds v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:NmZRIoxtL6iQdVK6n5W+JOx58K/0Yn8k7WuSvpKPQ+M= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad h1:WDl58zJKHfwbzHs+ZB8Jq3YNgVQE5Neu2NeaX3FZuyU= +github.com/iotaledger/hive.go/ierrors v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39 h1:Gp2h+Els9cTVYYnYsHX3zLuixb0XggIj2okK570aKww= github.com/iotaledger/hive.go/kvstore v0.0.0-20231205131244-472357435a39/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY= -github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39 h1:Di2G2i/hGyhe3D8j/MsnZqnx1yJBiMdbXDIrtbWpe8g= -github.com/iotaledger/hive.go/lo v0.0.0-20231205131244-472357435a39/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg= -github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39 h1:kYj16hPQ0iH+1srDaIj4wZCGH5qrhsFpHkLbh3Ob1Bs= -github.com/iotaledger/hive.go/log v0.0.0-20231205131244-472357435a39/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM= -github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39 h1:O6tJNVV544ts/DKIIfHQJNGXIPZgntR1DJ4e+jPR9rQ= -github.com/iotaledger/hive.go/runtime v0.0.0-20231205131244-472357435a39/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39 h1:GPa5qfHm59jqY3pff0eCnt/mpWFm6fibVK/n/E+Pfyk= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231205131244-472357435a39/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= -github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39 h1:gatLNIqLC/MAR5qlj+413/y0LmyfKC0QL2BKXLniD0M= -github.com/iotaledger/hive.go/stringify v0.0.0-20231205131244-472357435a39/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= -github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559 h1:qCXtPHNkshYFS9DJZEV0WeJEkN50syEuhFZobJjAIbw= -github.com/iotaledger/iota.go/v4 v4.0.0-20231206094936-1d3d3ed96559/go.mod h1:lCk9rhP3B5pX9BKhzR+Jobq4xPd+GHlqgF4Ga+eQfWA= +github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad h1:qpCsjw+InLL824QPu3lY/osck4DhucBKhCs5/E8OH+A= +github.com/iotaledger/hive.go/lo v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:ETXGXymFyNcUq2t4I9e7ZK18f9bxUWYat4pjZ9W0rWc= +github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c h1:Ksts6VjPj9y0o2Nis+2tHtDGWITNJ4yju87ZlHLPuOo= +github.com/iotaledger/hive.go/log v0.0.0-20231206113509-4b4ff95ac61c/go.mod h1:Td3R6QmYw0svZI1GuZ/tN9s0VNaHassXSKLCc70aX9w= +github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad h1:HpupWK8iqFt+Sdogkh2/N8ojalmevYy+FzhjOuy7Y7E= +github.com/iotaledger/hive.go/runtime v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:Z9NFsByMh1Kf98f3v3ifeZRycbS2db1hjswTQG1MxnE= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad h1:c8uwbBZDqpiCNN9/9Jji7Z4lL0GdVnORp8WMouiuknk= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231206114953-6a65a82e30ad/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= +github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad h1:VC3OgdSbyngY7/gxVj66fKd/nGmN6P0/myr348nx7vA= +github.com/iotaledger/hive.go/stringify v0.0.0-20231206114953-6a65a82e30ad/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5 h1:0KgQFpVRnKd6CdCwXo3Kg/SL27xkeKh2SMoU5G1TkZk= +github.com/iotaledger/iota.go/v4 v4.0.0-20231206123921-2af411eef0b5/go.mod h1:tiswk1O1wSAi9GE6tD1j43+bLmWU9Je07aZLaJ0+Ha0= 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= @@ -93,8 +93,8 @@ github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c/go.mod h1:1iCZ0433 github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 h1:+qIP3OMrT7SN5kLnTcVEISPOMB/97RyAKTg1UWA738E= +github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pokt-network/smt v0.6.1 h1:u5yTGNNND6edXv3vMQrAcjku1Ig4osehdu+EMYSXHUU= diff --git a/tools/genesis-snapshot/presets/presets.go b/tools/genesis-snapshot/presets/presets.go index bfbd492a2..071477fca 100644 --- a/tools/genesis-snapshot/presets/presets.go +++ b/tools/genesis-snapshot/presets/presets.go @@ -15,18 +15,18 @@ import ( var ( // use defaults from iota.go - protocolParamsBase = iotago.NewV3TestProtocolParameters( - iotago.WithNetworkOptions("default"), + protocolParamsBase = iotago.NewV3SnapshotProtocolParameters( + iotago.WithNetworkOptions("default", iotago.PrefixTestnet), ) // use defaults from iota.go - protocolParamsDocker = iotago.NewV3TestProtocolParameters( - iotago.WithNetworkOptions("docker"), + protocolParamsDocker = iotago.NewV3SnapshotProtocolParameters( + iotago.WithNetworkOptions("docker", iotago.PrefixTestnet), ) // use defaults from iota.go - protocolParamsFeature = iotago.NewV3TestProtocolParameters( - iotago.WithNetworkOptions("feature"), + protocolParamsFeature = iotago.NewV3SnapshotProtocolParameters( + iotago.WithNetworkOptions("feature", iotago.PrefixTestnet), ) ) From 6adaa025e75baa1ed6756f271e5e5d663baa8f5b Mon Sep 17 00:00:00 2001 From: muXxer Date: Wed, 6 Dec 2023 14:19:37 +0100 Subject: [PATCH 08/10] Revert time provider option changes in presets --- tools/genesis-snapshot/presets/presets.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/genesis-snapshot/presets/presets.go b/tools/genesis-snapshot/presets/presets.go index 071477fca..a8e72f12e 100644 --- a/tools/genesis-snapshot/presets/presets.go +++ b/tools/genesis-snapshot/presets/presets.go @@ -1,6 +1,8 @@ package presets import ( + "time" + "golang.org/x/crypto/blake2b" "github.com/iotaledger/hive.go/crypto/ed25519" @@ -22,11 +24,13 @@ var ( // use defaults from iota.go protocolParamsDocker = iotago.NewV3SnapshotProtocolParameters( iotago.WithNetworkOptions("docker", iotago.PrefixTestnet), + iotago.WithTimeProviderOptions(5, time.Now().Unix(), 10, 13), ) // use defaults from iota.go protocolParamsFeature = iotago.NewV3SnapshotProtocolParameters( iotago.WithNetworkOptions("feature", iotago.PrefixTestnet), + iotago.WithTimeProviderOptions(666666, time.Now().Unix()-100_000, 10, 13), ) ) From 32a6b24ee2d8770ac95f060b780abd3ada09d2c7 Mon Sep 17 00:00:00 2001 From: jonastheis <4181434+jonastheis@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:09:15 +0800 Subject: [PATCH 09/10] Replace ChainSwitchingThreshold option in protocol with ProtocolParameter --- pkg/protocol/chains.go | 5 +++-- pkg/protocol/options.go | 14 +------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/pkg/protocol/chains.go b/pkg/protocol/chains.go index 9704fca55..97af7125f 100644 --- a/pkg/protocol/chains.go +++ b/pkg/protocol/chains.go @@ -55,7 +55,7 @@ func newChains(protocol *Protocol) *Chains { shutdown := lo.Batch( c.initLogger(protocol.NewChildLogger("Chains")), - c.initChainSwitching(protocol.Options.ChainSwitchingThreshold), + c.initChainSwitching(), protocol.Constructed.WithNonEmptyValue(func(_ bool) (shutdown func()) { return c.deriveLatestSeenSlot(protocol) @@ -92,7 +92,7 @@ func (c *Chains) initLogger(logger log.Logger, shutdownLogger func()) (shutdown } // initChainSwitching initializes the chain switching logic. -func (c *Chains) initChainSwitching(chainSwitchingThreshold iotago.SlotIndex) (shutdown func()) { +func (c *Chains) initChainSwitching() (shutdown func()) { mainChain := c.newChain() mainChain.StartEngine.Set(true) @@ -102,6 +102,7 @@ func (c *Chains) initChainSwitching(chainSwitchingThreshold iotago.SlotIndex) (s forkingPointBelowChainSwitchingThreshold := func(chain *Chain) func(_ *Commitment, latestCommitment *Commitment) bool { return func(_ *Commitment, latestCommitment *Commitment) bool { forkingPoint := chain.ForkingPoint.Get() + chainSwitchingThreshold := iotago.SlotIndex(c.protocol.APIForSlot(latestCommitment.Slot()).ProtocolParameters().ChainSwitchingThreshold()) return forkingPoint != nil && latestCommitment != nil && (latestCommitment.ID().Slot()-forkingPoint.ID().Slot()) > chainSwitchingThreshold } diff --git a/pkg/protocol/options.go b/pkg/protocol/options.go index ac9605bf8..c3b260923 100644 --- a/pkg/protocol/options.go +++ b/pkg/protocol/options.go @@ -51,10 +51,6 @@ type Options struct { // SnapshotPath is the path to the snapshot file that should be used to initialize the protocol. SnapshotPath string - // ChainSwitchingThreshold is the threshold that defines how far away a heavier chain needs to be from its forking - // point to be considered for switching. - ChainSwitchingThreshold iotago.SlotIndex - // EngineOptions contains the options for the Engines. EngineOptions []options.Option[engine.Engine] @@ -120,8 +116,7 @@ type Options struct { // NewDefaultOptions creates new default options instance for the Protocol. func NewDefaultOptions() *Options { return &Options{ - BaseDirectory: "", - ChainSwitchingThreshold: 3, + BaseDirectory: "", PreSolidFilterProvider: presolidblockfilter.NewProvider(), PostSolidFilterProvider: postsolidblockfilter.NewProvider(), @@ -157,13 +152,6 @@ func WithSnapshotPath(snapshot string) options.Option[Protocol] { } } -// WithChainSwitchingThreshold is an option for the Protocol that allows to set the chain switching threshold. -func WithChainSwitchingThreshold(threshold iotago.SlotIndex) options.Option[Protocol] { - return func(p *Protocol) { - p.Options.ChainSwitchingThreshold = threshold - } -} - // WithPreSolidFilterProvider is an option for the Protocol that allows to set the PreSolidFilterProvider. func WithPreSolidFilterProvider(optsFilterProvider module.Provider[*engine.Engine, presolidfilter.PreSolidFilter]) options.Option[Protocol] { return func(p *Protocol) { From c6249054419f72405c392697479d99a3b15f5a73 Mon Sep 17 00:00:00 2001 From: muXxer Date: Tue, 5 Dec 2023 18:18:58 +0100 Subject: [PATCH 10/10] Add LatestParentBlockIssuingTime to BlockIssuance endpoint --- components/restapi/core/blocks.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/components/restapi/core/blocks.go b/components/restapi/core/blocks.go index bab9de006..cd3b91bd0 100644 --- a/components/restapi/core/blocks.go +++ b/components/restapi/core/blocks.go @@ -1,6 +1,8 @@ package core import ( + "time" + "github.com/labstack/echo/v4" "github.com/iotaledger/hive.go/ierrors" @@ -84,12 +86,28 @@ func blockIssuance() (*api.IssuanceBlockHeaderResponse, error) { return nil, ierrors.Wrap(echo.ErrServiceUnavailable, "no strong parents available") } + // get the latest parent block issuing time + var latestParentBlockIssuingTime time.Time + for _, parentType := range []iotago.ParentsType{iotago.StrongParentType, iotago.WeakParentType, iotago.ShallowLikeParentType} { + for _, blockID := range references[parentType] { + block, exists := deps.Protocol.Engines.Main.Get().Block(blockID) + if !exists { + return nil, ierrors.Wrapf(echo.ErrNotFound, "no block found for parent, block ID: %s", blockID.ToHex()) + } + + if latestParentBlockIssuingTime.Before(block.ProtocolBlock().Header.IssuingTime) { + latestParentBlockIssuingTime = block.ProtocolBlock().Header.IssuingTime + } + } + } + resp := &api.IssuanceBlockHeaderResponse{ - StrongParents: references[iotago.StrongParentType], - WeakParents: references[iotago.WeakParentType], - ShallowLikeParents: references[iotago.ShallowLikeParentType], - LatestFinalizedSlot: deps.Protocol.Engines.Main.Get().SyncManager.LatestFinalizedSlot(), - LatestCommitment: deps.Protocol.Engines.Main.Get().SyncManager.LatestCommitment().Commitment(), + StrongParents: references[iotago.StrongParentType], + WeakParents: references[iotago.WeakParentType], + ShallowLikeParents: references[iotago.ShallowLikeParentType], + LatestParentBlockIssuingTime: latestParentBlockIssuingTime, + LatestFinalizedSlot: deps.Protocol.Engines.Main.Get().SyncManager.LatestFinalizedSlot(), + LatestCommitment: deps.Protocol.Engines.Main.Get().SyncManager.LatestCommitment().Commitment(), } return resp, nil