diff --git a/go.mod b/go.mod index 2c22b2149..022cb8554 100644 --- a/go.mod +++ b/go.mod @@ -11,19 +11,20 @@ require ( github.com/google/uuid v1.3.1 github.com/gorilla/websocket v1.5.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/iotaledger/hive.go/ads v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 + github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230927140518-622f63be6182 github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230927140257-bfa0bb0af2bd github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c diff --git a/go.sum b/go.sum index 49a8b5b59..516eac940 100644 --- a/go.sum +++ b/go.sum @@ -275,32 +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-20230928074706-d58e32f86729 h1:HHxgNhbtD6WDCwSQBbPrQe8c4ZNjNi0KcgCJo0nm9bY= -github.com/iotaledger/hive.go/ads v0.0.0-20230928074706-d58e32f86729/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= -github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729 h1:rBADf+IZDKkDOuZznwIdonxF9jcOSQJU/qOYSNInX84= -github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729/go.mod h1:eiZgbcwTDZ7d9hEait2EAwAhixWhceW4MXmuVk2EcEw= -github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729 h1:PQ9TFyXBrV6LLTOzE43CV/vz+ItN5v6lcA7ms0YOvcE= -github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 h1:mwIZhduBiOD4rG4hqrPhW616EU1wX4eD2zHu26be5Yc= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729 h1:FpFlPNOHcvHDyk1gN3OuL/hgvTKVsc5IN+q8U1YF9P4= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 h1:hHdIZn95+HdP1JdjV8TAsuL5kU4eb4gncehyjXo/feQ= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 h1:+/OtOAx2tMy8ER3XBt9RpnspWyDrVqW6kQGAd24jT0k= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 h1:XCYvP8XwETTXF5LNz8q9X3EajDut7+UwTwqJ2TQ0TJo= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 h1:hW4r9no+03ufp2fyx4IjTFwINkEz3OI3LqvSjv7SJ1c= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= -github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729 h1:FOQetJY2scpCtCGrZQWGw3RwB3lRIDdyu+M6P1NACM4= -github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 h1:4aRR9UG4dHpdlTcMN1Px++eaxlGXXk1n6co8t/WlchM= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 h1:mPmP3/0XJAf0ZkCzQenpoQPMv+m56Z8+A1i/UO18Hdw= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 h1:gZlIK1OzdA3aZ78PsiWe3poVzawyw4S3zboMHE1TrY0= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d h1:VLGhDCBxGNKq+ueqsZN+abBTKIHxm8tSWUL7OfJHcNw= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= +github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d h1:oI57ETG+XsCYbYBpbJT3k06ixPUv0gTdzBqf84ohkRo= +github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d/go.mod h1:eiZgbcwTDZ7d9hEait2EAwAhixWhceW4MXmuVk2EcEw= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d h1:bZXrxulDoDBsNg0wtXowrAyltjfgZahiGYuAoS5GKU4= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d h1:pRcB0wfWAlfDJ10ZZ6LK1ukRXcPaL299LLU/zbYWnsQ= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d h1:Vn8BY/hLTcKJWh8LCw6PDTbCK2562wq93MPynV1pHjE= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d h1:bTBfkwg5UOZrj/13N/YZyi3RYJjNwSpjKfkJdqvz5OU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d h1:tmaZvkBCP/OrQrwC728AEFtRAW8YUHBVNE8IXxtd4C4= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d h1:CxOlK2QbijArZTHNwB1wR03wcW2qCzqCyoc9MFWE5L8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d h1:qNmg1DUvge8zPvygQEoulQjLG7gFzWKqPMJ3r7ZESm0= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d h1:u8pGLFhi7LnFOqqt3Q2buC3UjKX5l4e8bJ4wMjAU+Rg= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d/go.mod h1:UF7PzlWdZ2H0Hkxrt4AgJmNVeMXUJzw4RwbHpib1DB0= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d h1:BpfdehuhnIsl2VtPOSnhKYAbLx8rSeyODz5TJ7kRTfw= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d h1:mn2Gax95UuUpuzEi4osLk+1IBjv5q56LwcxF/lAxk38= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d h1:1839CFkegKrSvTfWkgYHpH1pudehOXxX05Mzy1KSR7I= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d h1:ekHWRypoaiCXgrJVUQS7rCewsK3FuG1gTbPxu5jYn9c= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230927140518-622f63be6182 h1:lQiktl3Q0B+cHbVum7WzJikOEP+buw686oSrw5Unyz8= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230927140518-622f63be6182/go.mod h1:q24QEsS887ZWJVX76w2kwSgC84KS7wIKOy1otuqZ2ZM= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230927140257-bfa0bb0af2bd h1:nFG3Zq/zFA4KhBYFX2IezX1C74zfE0DqCt0LrgTa9Ig= diff --git a/pkg/tests/protocol_engine_rollback_test.go b/pkg/tests/protocol_engine_rollback_test.go index 79381bf1f..a6f2c2840 100644 --- a/pkg/tests/protocol_engine_rollback_test.go +++ b/pkg/tests/protocol_engine_rollback_test.go @@ -1,785 +1,785 @@ package tests -import ( - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/iotaledger/hive.go/core/eventticker" - "github.com/iotaledger/hive.go/lo" - "github.com/iotaledger/hive.go/runtime/module" - "github.com/iotaledger/hive.go/runtime/options" - "github.com/iotaledger/iota-core/pkg/core/account" - "github.com/iotaledger/iota-core/pkg/protocol" - "github.com/iotaledger/iota-core/pkg/protocol/chainmanager" - "github.com/iotaledger/iota-core/pkg/protocol/engine" - "github.com/iotaledger/iota-core/pkg/protocol/engine/blocks" - "github.com/iotaledger/iota-core/pkg/protocol/sybilprotection/seatmanager" - "github.com/iotaledger/iota-core/pkg/protocol/sybilprotection/seatmanager/mock" - "github.com/iotaledger/iota-core/pkg/protocol/sybilprotection/sybilprotectionv1" - "github.com/iotaledger/iota-core/pkg/storage" - "github.com/iotaledger/iota-core/pkg/testsuite" - mock2 "github.com/iotaledger/iota-core/pkg/testsuite/mock" - iotago "github.com/iotaledger/iota.go/v4" -) - -func TestProtocol_EngineRollbackFinalization(t *testing.T) { - ts := testsuite.NewTestSuite(t, - testsuite.WithLivenessThresholdLowerBound(10), - testsuite.WithLivenessThresholdUpperBound(10), - testsuite.WithMinCommittableAge(2), - testsuite.WithMaxCommittableAge(3), - testsuite.WithEpochNearingThreshold(5), - testsuite.WithSlotsPerEpochExponent(3), - testsuite.WithGenesisTimestampOffset(1000*10), - - testsuite.WithWaitFor(15*time.Second), - ) - defer ts.Shutdown() - - node0 := ts.AddValidatorNode("node0") - node1 := ts.AddValidatorNode("node1") - node2 := ts.AddValidatorNode("node2") - node3 := ts.AddValidatorNode("node3") - - poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { - return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { - poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) - - for _, node := range []*mock2.Node{node0, node1, node2, node3} { - if node.Validator { - poa.AddAccount(node.AccountID, node.Name) - } - } - poa.SetOnline("node0", "node1", "node2", "node3") - - return poa - }) - } - - nodeOptions := make(map[string][]options.Option[protocol.Protocol]) - for _, node := range ts.Nodes() { - nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ - protocol.WithChainManagerOptions( - chainmanager.WithCommitmentRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), - ), - ), - protocol.WithSybilProtectionProvider( - sybilprotectionv1.NewProvider( - sybilprotectionv1.WithSeatManagerProvider( - poaProvider(), - ), - ), - ), - protocol.WithEngineOptions( - engine.WithBlockRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), - ), - ), - protocol.WithStorageOptions( - storage.WithPruningDelay(20), - ), - } - } - - ts.Run(false, nodeOptions) - - // Verify that nodes have the expected states. - - expectedCommittee := []iotago.AccountID{ - node0.AccountID, - node1.AccountID, - node2.AccountID, - node3.AccountID, - } - expectedOnlineCommitteeFull := []account.SeatIndex{ - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), - } - - for _, node := range ts.Nodes() { - node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") - } - - { - genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) - genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost - ts.AssertNodeState(ts.Nodes(), - testsuite.WithSnapshotImported(true), - testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), - testsuite.WithLatestCommitment(genesisCommitment), - testsuite.WithLatestFinalizedSlot(0), - testsuite.WithChainID(genesisCommitment.MustID()), - testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), - - testsuite.WithSybilProtectionCommittee(0, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(0), - testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), - testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), - ) - } - - // Issue up to slot 11 - just before committee selection for the next epoch. - // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(8), - testsuite.WithLatestCommitmentSlotIndex(9), - testsuite.WithEqualStoredCommitmentAtIndex(9), - testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(9, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(9), - ) - - for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { - var attestationBlocks []*blocks.Block - for _, node := range ts.Nodes() { - if node.Validator { - attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) - } - } - ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) - } - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15, 16}, 4, "P0:11.3", ts.Nodes(), true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(13), - testsuite.WithLatestCommitmentSlotIndex(14), - testsuite.WithEqualStoredCommitmentAtIndex(14), - testsuite.WithLatestCommitmentCumulativeWeight(48), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(14, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(14), - ) - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(13) - require.NoError(t, err) - - // Assert state of the forked engine after rollback. - { - require.EqualValues(t, 13, newEngine.Storage.Settings().LatestCommitment().Slot()) - require.EqualValues(t, 13, newEngine.Storage.Settings().LatestFinalizedSlot()) - require.EqualValues(t, 13, newEngine.EvictionState.LastEvictedSlot()) - - for epoch := 0; epoch <= 2; epoch++ { - committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) - require.NoError(t, err) - require.Len(t, committeeEpoch.IDs(), 4) - } - - // Commmittee for the future epoch does not exist. - committeeEpoch3, err := newEngine.Storage.Committee().Load(3) - require.NoError(t, err) - require.Nil(t, committeeEpoch3) - - for slot := 1; slot <= 13; slot++ { - copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) - } - - // Commitment for the first slot after the fork does not exist. - _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(14)) - require.Error(t, err) - } -} - -func TestProtocol_EngineRollbackNoFinalization(t *testing.T) { - ts := testsuite.NewTestSuite(t, - testsuite.WithLivenessThresholdLowerBound(10), - testsuite.WithLivenessThresholdUpperBound(10), - testsuite.WithMinCommittableAge(2), - testsuite.WithMaxCommittableAge(3), - testsuite.WithEpochNearingThreshold(5), - testsuite.WithSlotsPerEpochExponent(3), - testsuite.WithGenesisTimestampOffset(1000*10), - - testsuite.WithWaitFor(15*time.Second), - ) - defer ts.Shutdown() - - node0 := ts.AddValidatorNode("node0") - node1 := ts.AddValidatorNode("node1") - node2 := ts.AddValidatorNode("node2") - node3 := ts.AddValidatorNode("node3") - - poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { - return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { - poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) - - for _, node := range []*mock2.Node{node0, node1, node2, node3} { - if node.Validator { - poa.AddAccount(node.AccountID, node.Name) - } - } - poa.SetOnline("node0", "node1", "node2", "node3") - - return poa - }) - } - - nodeOptions := make(map[string][]options.Option[protocol.Protocol]) - for _, node := range ts.Nodes() { - nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ - protocol.WithChainManagerOptions( - chainmanager.WithCommitmentRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), - ), - ), - protocol.WithSybilProtectionProvider( - sybilprotectionv1.NewProvider( - sybilprotectionv1.WithSeatManagerProvider( - poaProvider(), - ), - ), - ), - protocol.WithEngineOptions( - engine.WithBlockRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), - ), - ), - protocol.WithStorageOptions( - storage.WithPruningDelay(20), - ), - } - } - - ts.Run(false, nodeOptions) - - // Verify that nodes have the expected states. - - expectedCommittee := []iotago.AccountID{ - node0.AccountID, - node1.AccountID, - node2.AccountID, - node3.AccountID, - } - expectedOnlineCommitteeFull := []account.SeatIndex{ - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), - } - - expectedOnlineCommitteeHalf := []account.SeatIndex{ - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), - } - - for _, node := range ts.Nodes() { - node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") - } - - { - genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) - genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost - ts.AssertNodeState(ts.Nodes(), - testsuite.WithSnapshotImported(true), - testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), - testsuite.WithLatestCommitment(genesisCommitment), - testsuite.WithLatestFinalizedSlot(0), - testsuite.WithChainID(genesisCommitment.MustID()), - testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), - - testsuite.WithSybilProtectionCommittee(0, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(0), - testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), - testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), - ) - } - - // Issue up to slot 11 - just before committee selection for the next epoch. - // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(8), - testsuite.WithLatestCommitmentSlotIndex(9), - testsuite.WithEqualStoredCommitmentAtIndex(9), - testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(9, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(9), - ) - - for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { - var attestationBlocks []*blocks.Block - for _, node := range ts.Nodes() { - if node.Validator { - attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) - } - } - ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) - } - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - // Update online committee. - for _, node := range ts.Nodes() { - manualPOA := node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA) - manualPOA.SetOnline("node0", "node1") - manualPOA.SetOffline("node2", "node3") - } - - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15, 16}, 4, "P0:11.3", []*mock2.Node{node0, node1}, true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(8), - testsuite.WithLatestCommitmentSlotIndex(14), - testsuite.WithEqualStoredCommitmentAtIndex(14), - testsuite.WithLatestCommitmentCumulativeWeight(44), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(14, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeHalf...), - testsuite.WithEvictedSlot(14), - ) - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(13) - require.NoError(t, err) - - // Assert state of the forked engine after rollback. - { - require.EqualValues(t, 13, newEngine.Storage.Settings().LatestCommitment().Slot()) - require.EqualValues(t, 8, newEngine.Storage.Settings().LatestFinalizedSlot()) - require.EqualValues(t, 13, newEngine.EvictionState.LastEvictedSlot()) - - for epoch := 0; epoch <= 2; epoch++ { - committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) - require.NoError(t, err) - require.Len(t, committeeEpoch.IDs(), 4) - } - - // Commmittee for the future epoch does not exist. - committeeEpoch3, err := newEngine.Storage.Committee().Load(3) - require.NoError(t, err) - require.Nil(t, committeeEpoch3) - - for slot := 1; slot <= 13; slot++ { - copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) - } - - // Commitment for the first slot after the fork does not exist. - _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(14)) - require.Error(t, err) - } -} - -func TestProtocol_EngineRollbackNoFinalizationLastSlot(t *testing.T) { - ts := testsuite.NewTestSuite(t, - testsuite.WithLivenessThresholdLowerBound(10), - testsuite.WithLivenessThresholdUpperBound(10), - testsuite.WithMinCommittableAge(2), - testsuite.WithMaxCommittableAge(3), - testsuite.WithEpochNearingThreshold(5), - testsuite.WithSlotsPerEpochExponent(3), - testsuite.WithGenesisTimestampOffset(1000*10), - - testsuite.WithWaitFor(15*time.Second), - ) - defer ts.Shutdown() - - node0 := ts.AddValidatorNode("node0") - node1 := ts.AddValidatorNode("node1") - node2 := ts.AddValidatorNode("node2") - node3 := ts.AddValidatorNode("node3") - - poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { - return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { - poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) - - for _, node := range []*mock2.Node{node0, node1, node2, node3} { - if node.Validator { - poa.AddAccount(node.AccountID, node.Name) - } - } - poa.SetOnline("node0", "node1", "node2", "node3") - - return poa - }) - } - - nodeOptions := make(map[string][]options.Option[protocol.Protocol]) - for _, node := range ts.Nodes() { - nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ - protocol.WithChainManagerOptions( - chainmanager.WithCommitmentRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), - ), - ), - protocol.WithSybilProtectionProvider( - sybilprotectionv1.NewProvider( - sybilprotectionv1.WithSeatManagerProvider( - poaProvider(), - ), - ), - ), - protocol.WithEngineOptions( - engine.WithBlockRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), - ), - ), - protocol.WithStorageOptions( - storage.WithPruningDelay(20), - ), - } - } - - ts.Run(false, nodeOptions) - - // Verify that nodes have the expected states. - - expectedCommittee := []iotago.AccountID{ - node0.AccountID, - node1.AccountID, - node2.AccountID, - node3.AccountID, - } - expectedOnlineCommitteeFull := []account.SeatIndex{ - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), - } - - expectedOnlineCommitteeHalf := []account.SeatIndex{ - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), - } - - for _, node := range ts.Nodes() { - node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") - } - - { - genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) - genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost - ts.AssertNodeState(ts.Nodes(), - testsuite.WithSnapshotImported(true), - testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), - testsuite.WithLatestCommitment(genesisCommitment), - testsuite.WithLatestFinalizedSlot(0), - testsuite.WithChainID(genesisCommitment.MustID()), - testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), - - testsuite.WithSybilProtectionCommittee(0, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(0), - testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), - testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), - ) - } - - // Issue up to slot 11 - just before committee selection for the next epoch. - // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(8), - testsuite.WithLatestCommitmentSlotIndex(9), - testsuite.WithEqualStoredCommitmentAtIndex(9), - testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(9, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(9), - ) - - for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { - var attestationBlocks []*blocks.Block - for _, node := range ts.Nodes() { - if node.Validator { - attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) - } - } - ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) - } - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - // Update online committee. - for _, node := range ts.Nodes() { - manualPOA := node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA) - manualPOA.SetOnline("node0", "node1") - manualPOA.SetOffline("node2", "node3") - } - - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15, 16, 17, 18, 19}, 4, "P0:11.3", []*mock2.Node{node0, node1}, true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(8), - testsuite.WithLatestCommitmentSlotIndex(17), - testsuite.WithEqualStoredCommitmentAtIndex(17), - testsuite.WithLatestCommitmentCumulativeWeight(50), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(17, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeHalf...), - testsuite.WithEvictedSlot(17), - ) - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(15) - require.NoError(t, err) - - // Assert state of the forked engine after rollback. - { - require.EqualValues(t, 15, newEngine.Storage.Settings().LatestCommitment().Slot()) - require.EqualValues(t, 8, newEngine.Storage.Settings().LatestFinalizedSlot()) - require.EqualValues(t, 15, newEngine.EvictionState.LastEvictedSlot()) - - for epoch := 0; epoch <= 2; epoch++ { - committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) - require.NoError(t, err) - require.Len(t, committeeEpoch.IDs(), 4) - } - - // Commmittee for the future epoch does not exist. - committeeEpoch3, err := newEngine.Storage.Committee().Load(3) - require.NoError(t, err) - require.Nil(t, committeeEpoch3) - - for slot := 1; slot <= 15; slot++ { - copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) - } - - // Commitment for the first slot after the fork does not exist. - _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(16)) - require.Error(t, err) - } -} - -func TestProtocol_EngineRollbackNoFinalizationBeforePointOfNoReturn(t *testing.T) { - ts := testsuite.NewTestSuite(t, - testsuite.WithLivenessThresholdLowerBound(10), - testsuite.WithLivenessThresholdUpperBound(10), - testsuite.WithMinCommittableAge(2), - testsuite.WithMaxCommittableAge(3), - testsuite.WithEpochNearingThreshold(5), - testsuite.WithSlotsPerEpochExponent(3), - testsuite.WithGenesisTimestampOffset(1000*10), - - testsuite.WithWaitFor(15*time.Second), - ) - defer ts.Shutdown() - - node0 := ts.AddValidatorNode("node0") - node1 := ts.AddValidatorNode("node1") - node2 := ts.AddValidatorNode("node2") - node3 := ts.AddValidatorNode("node3") - - poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { - return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { - poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) - - for _, node := range []*mock2.Node{node0, node1, node2, node3} { - if node.Validator { - poa.AddAccount(node.AccountID, node.Name) - } - } - poa.SetOnline("node0", "node1", "node2", "node3") - - return poa - }) - } - - nodeOptions := make(map[string][]options.Option[protocol.Protocol]) - for _, node := range ts.Nodes() { - nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ - protocol.WithChainManagerOptions( - chainmanager.WithCommitmentRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), - ), - ), - protocol.WithSybilProtectionProvider( - sybilprotectionv1.NewProvider( - sybilprotectionv1.WithSeatManagerProvider( - poaProvider(), - ), - ), - ), - protocol.WithEngineOptions( - engine.WithBlockRequesterOptions( - eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), - eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), - ), - ), - protocol.WithStorageOptions( - storage.WithPruningDelay(20), - ), - } - } - - ts.Run(false, nodeOptions) - - // Verify that nodes have the expected states. - - expectedCommittee := []iotago.AccountID{ - node0.AccountID, - node1.AccountID, - node2.AccountID, - node3.AccountID, - } - expectedOnlineCommitteeFull := []account.SeatIndex{ - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), - } - - expectedOnlineCommitteeHalf := []account.SeatIndex{ - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), - lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), - } - - for _, node := range ts.Nodes() { - node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") - } - - { - genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) - genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost - ts.AssertNodeState(ts.Nodes(), - testsuite.WithSnapshotImported(true), - testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), - testsuite.WithLatestCommitment(genesisCommitment), - testsuite.WithLatestFinalizedSlot(0), - testsuite.WithChainID(genesisCommitment.MustID()), - testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), - - testsuite.WithSybilProtectionCommittee(0, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(0), - testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), - testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), - ) - } - - // Issue up to slot 11 - just before committee selection for the next epoch. - // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(8), - testsuite.WithLatestCommitmentSlotIndex(9), - testsuite.WithEqualStoredCommitmentAtIndex(9), - testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(9, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), - testsuite.WithEvictedSlot(9), - ) - - for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { - var attestationBlocks []*blocks.Block - for _, node := range ts.Nodes() { - if node.Validator { - attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) - } - } - ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) - } - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - // Update online committee. - for _, node := range ts.Nodes() { - manualPOA := node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA) - manualPOA.SetOnline("node0", "node1") - manualPOA.SetOffline("node2", "node3") - } - - { - ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15}, 4, "P0:11.3", []*mock2.Node{node0, node1}, true, nil) - - ts.AssertNodeState(ts.Nodes(), - testsuite.WithLatestFinalizedSlot(8), - testsuite.WithLatestCommitmentSlotIndex(13), - testsuite.WithEqualStoredCommitmentAtIndex(13), - testsuite.WithLatestCommitmentCumulativeWeight(42), // 7 for each slot starting from 4 - testsuite.WithSybilProtectionCommittee(13, expectedCommittee), - testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeHalf...), - testsuite.WithEvictedSlot(13), - ) - - ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) - } - - newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(9) - require.NoError(t, err) - - // Assert state of the forked engine after rollback. - { - require.EqualValues(t, 9, newEngine.Storage.Settings().LatestCommitment().Slot()) - require.EqualValues(t, 8, newEngine.Storage.Settings().LatestFinalizedSlot()) - require.EqualValues(t, 9, newEngine.EvictionState.LastEvictedSlot()) - - for epoch := 0; epoch <= 1; epoch++ { - committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) - require.NoError(t, err) - require.Len(t, committeeEpoch.IDs(), 4) - } - - // Commmittee for the future epoch does not exist. - committeeEpoch2, err := newEngine.Storage.Committee().Load(2) - require.NoError(t, err) - require.Nil(t, committeeEpoch2) - - for slot := 1; slot <= 9; slot++ { - copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) - require.NoError(t, err) - require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) - } - - // Commitment for the first slot after the fork does not exist. - _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(10)) - require.Error(t, err) - } -} - -// TODO: test fork before point of no return (slot 12) -// TODO: test fork on last slot of an epoch (slot 15) +//import ( +// "fmt" +// "testing" +// "time" +// +// "github.com/stretchr/testify/require" +// +// "github.com/iotaledger/hive.go/core/eventticker" +// "github.com/iotaledger/hive.go/lo" +// "github.com/iotaledger/hive.go/runtime/module" +// "github.com/iotaledger/hive.go/runtime/options" +// "github.com/iotaledger/iota-core/pkg/core/account" +// "github.com/iotaledger/iota-core/pkg/protocol" +// "github.com/iotaledger/iota-core/pkg/protocol/chainmanager" +// "github.com/iotaledger/iota-core/pkg/protocol/engine" +// "github.com/iotaledger/iota-core/pkg/protocol/engine/blocks" +// "github.com/iotaledger/iota-core/pkg/protocol/sybilprotection/seatmanager" +// "github.com/iotaledger/iota-core/pkg/protocol/sybilprotection/seatmanager/mock" +// "github.com/iotaledger/iota-core/pkg/protocol/sybilprotection/sybilprotectionv1" +// "github.com/iotaledger/iota-core/pkg/storage" +// "github.com/iotaledger/iota-core/pkg/testsuite" +// mock2 "github.com/iotaledger/iota-core/pkg/testsuite/mock" +// iotago "github.com/iotaledger/iota.go/v4" +//) +// +//func TestProtocol_EngineRollbackFinalization(t *testing.T) { +// ts := testsuite.NewTestSuite(t, +// testsuite.WithLivenessThresholdLowerBound(10), +// testsuite.WithLivenessThresholdUpperBound(10), +// testsuite.WithMinCommittableAge(2), +// testsuite.WithMaxCommittableAge(3), +// testsuite.WithEpochNearingThreshold(5), +// testsuite.WithSlotsPerEpochExponent(3), +// testsuite.WithGenesisTimestampOffset(1000*10), +// +// testsuite.WithWaitFor(15*time.Second), +// ) +// defer ts.Shutdown() +// +// node0 := ts.AddValidatorNode("node0") +// node1 := ts.AddValidatorNode("node1") +// node2 := ts.AddValidatorNode("node2") +// node3 := ts.AddValidatorNode("node3") +// +// poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { +// return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { +// poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) +// +// for _, node := range []*mock2.Node{node0, node1, node2, node3} { +// if node.Validator { +// poa.AddAccount(node.AccountID, node.Name) +// } +// } +// poa.SetOnline("node0", "node1", "node2", "node3") +// +// return poa +// }) +// } +// +// nodeOptions := make(map[string][]options.Option[protocol.Protocol]) +// for _, node := range ts.Nodes() { +// nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ +// protocol.WithChainManagerOptions( +// chainmanager.WithCommitmentRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), +// ), +// ), +// protocol.WithSybilProtectionProvider( +// sybilprotectionv1.NewProvider( +// sybilprotectionv1.WithSeatManagerProvider( +// poaProvider(), +// ), +// ), +// ), +// protocol.WithEngineOptions( +// engine.WithBlockRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), +// ), +// ), +// protocol.WithStorageOptions( +// storage.WithPruningDelay(20), +// ), +// } +// } +// +// ts.Run(false, nodeOptions) +// +// // Verify that nodes have the expected states. +// +// expectedCommittee := []iotago.AccountID{ +// node0.AccountID, +// node1.AccountID, +// node2.AccountID, +// node3.AccountID, +// } +// expectedOnlineCommitteeFull := []account.SeatIndex{ +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), +// } +// +// for _, node := range ts.Nodes() { +// node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") +// } +// +// { +// genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) +// genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithSnapshotImported(true), +// testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), +// testsuite.WithLatestCommitment(genesisCommitment), +// testsuite.WithLatestFinalizedSlot(0), +// testsuite.WithChainID(genesisCommitment.MustID()), +// testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), +// +// testsuite.WithSybilProtectionCommittee(0, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(0), +// testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), +// testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), +// ) +// } +// +// // Issue up to slot 11 - just before committee selection for the next epoch. +// // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(8), +// testsuite.WithLatestCommitmentSlotIndex(9), +// testsuite.WithEqualStoredCommitmentAtIndex(9), +// testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(9, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(9), +// ) +// +// for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { +// var attestationBlocks []*blocks.Block +// for _, node := range ts.Nodes() { +// if node.Validator { +// attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) +// } +// } +// ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) +// } +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15, 16}, 4, "P0:11.3", ts.Nodes(), true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(13), +// testsuite.WithLatestCommitmentSlotIndex(14), +// testsuite.WithEqualStoredCommitmentAtIndex(14), +// testsuite.WithLatestCommitmentCumulativeWeight(48), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(14, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(14), +// ) +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(13) +// require.NoError(t, err) +// +// // Assert state of the forked engine after rollback. +// { +// require.EqualValues(t, 13, newEngine.Storage.Settings().LatestCommitment().Slot()) +// require.EqualValues(t, 13, newEngine.Storage.Settings().LatestFinalizedSlot()) +// require.EqualValues(t, 13, newEngine.EvictionState.LastEvictedSlot()) +// +// for epoch := 0; epoch <= 2; epoch++ { +// committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) +// require.NoError(t, err) +// require.Len(t, committeeEpoch.IDs(), 4) +// } +// +// // Commmittee for the future epoch does not exist. +// committeeEpoch3, err := newEngine.Storage.Committee().Load(3) +// require.NoError(t, err) +// require.Nil(t, committeeEpoch3) +// +// for slot := 1; slot <= 13; slot++ { +// copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) +// } +// +// // Commitment for the first slot after the fork does not exist. +// _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(14)) +// require.Error(t, err) +// } +//} +// +//func TestProtocol_EngineRollbackNoFinalization(t *testing.T) { +// ts := testsuite.NewTestSuite(t, +// testsuite.WithLivenessThresholdLowerBound(10), +// testsuite.WithLivenessThresholdUpperBound(10), +// testsuite.WithMinCommittableAge(2), +// testsuite.WithMaxCommittableAge(3), +// testsuite.WithEpochNearingThreshold(5), +// testsuite.WithSlotsPerEpochExponent(3), +// testsuite.WithGenesisTimestampOffset(1000*10), +// +// testsuite.WithWaitFor(15*time.Second), +// ) +// defer ts.Shutdown() +// +// node0 := ts.AddValidatorNode("node0") +// node1 := ts.AddValidatorNode("node1") +// node2 := ts.AddValidatorNode("node2") +// node3 := ts.AddValidatorNode("node3") +// +// poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { +// return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { +// poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) +// +// for _, node := range []*mock2.Node{node0, node1, node2, node3} { +// if node.Validator { +// poa.AddAccount(node.AccountID, node.Name) +// } +// } +// poa.SetOnline("node0", "node1", "node2", "node3") +// +// return poa +// }) +// } +// +// nodeOptions := make(map[string][]options.Option[protocol.Protocol]) +// for _, node := range ts.Nodes() { +// nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ +// protocol.WithChainManagerOptions( +// chainmanager.WithCommitmentRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), +// ), +// ), +// protocol.WithSybilProtectionProvider( +// sybilprotectionv1.NewProvider( +// sybilprotectionv1.WithSeatManagerProvider( +// poaProvider(), +// ), +// ), +// ), +// protocol.WithEngineOptions( +// engine.WithBlockRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), +// ), +// ), +// protocol.WithStorageOptions( +// storage.WithPruningDelay(20), +// ), +// } +// } +// +// ts.Run(false, nodeOptions) +// +// // Verify that nodes have the expected states. +// +// expectedCommittee := []iotago.AccountID{ +// node0.AccountID, +// node1.AccountID, +// node2.AccountID, +// node3.AccountID, +// } +// expectedOnlineCommitteeFull := []account.SeatIndex{ +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), +// } +// +// expectedOnlineCommitteeHalf := []account.SeatIndex{ +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), +// } +// +// for _, node := range ts.Nodes() { +// node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") +// } +// +// { +// genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) +// genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithSnapshotImported(true), +// testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), +// testsuite.WithLatestCommitment(genesisCommitment), +// testsuite.WithLatestFinalizedSlot(0), +// testsuite.WithChainID(genesisCommitment.MustID()), +// testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), +// +// testsuite.WithSybilProtectionCommittee(0, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(0), +// testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), +// testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), +// ) +// } +// +// // Issue up to slot 11 - just before committee selection for the next epoch. +// // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(8), +// testsuite.WithLatestCommitmentSlotIndex(9), +// testsuite.WithEqualStoredCommitmentAtIndex(9), +// testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(9, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(9), +// ) +// +// for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { +// var attestationBlocks []*blocks.Block +// for _, node := range ts.Nodes() { +// if node.Validator { +// attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) +// } +// } +// ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) +// } +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// // Update online committee. +// for _, node := range ts.Nodes() { +// manualPOA := node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA) +// manualPOA.SetOnline("node0", "node1") +// manualPOA.SetOffline("node2", "node3") +// } +// +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15, 16}, 4, "P0:11.3", []*mock2.Node{node0, node1}, true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(8), +// testsuite.WithLatestCommitmentSlotIndex(14), +// testsuite.WithEqualStoredCommitmentAtIndex(14), +// testsuite.WithLatestCommitmentCumulativeWeight(44), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(14, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeHalf...), +// testsuite.WithEvictedSlot(14), +// ) +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(13) +// require.NoError(t, err) +// +// // Assert state of the forked engine after rollback. +// { +// require.EqualValues(t, 13, newEngine.Storage.Settings().LatestCommitment().Slot()) +// require.EqualValues(t, 8, newEngine.Storage.Settings().LatestFinalizedSlot()) +// require.EqualValues(t, 13, newEngine.EvictionState.LastEvictedSlot()) +// +// for epoch := 0; epoch <= 2; epoch++ { +// committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) +// require.NoError(t, err) +// require.Len(t, committeeEpoch.IDs(), 4) +// } +// +// // Commmittee for the future epoch does not exist. +// committeeEpoch3, err := newEngine.Storage.Committee().Load(3) +// require.NoError(t, err) +// require.Nil(t, committeeEpoch3) +// +// for slot := 1; slot <= 13; slot++ { +// copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) +// } +// +// // Commitment for the first slot after the fork does not exist. +// _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(14)) +// require.Error(t, err) +// } +//} +// +//func TestProtocol_EngineRollbackNoFinalizationLastSlot(t *testing.T) { +// ts := testsuite.NewTestSuite(t, +// testsuite.WithLivenessThresholdLowerBound(10), +// testsuite.WithLivenessThresholdUpperBound(10), +// testsuite.WithMinCommittableAge(2), +// testsuite.WithMaxCommittableAge(3), +// testsuite.WithEpochNearingThreshold(5), +// testsuite.WithSlotsPerEpochExponent(3), +// testsuite.WithGenesisTimestampOffset(1000*10), +// +// testsuite.WithWaitFor(15*time.Second), +// ) +// defer ts.Shutdown() +// +// node0 := ts.AddValidatorNode("node0") +// node1 := ts.AddValidatorNode("node1") +// node2 := ts.AddValidatorNode("node2") +// node3 := ts.AddValidatorNode("node3") +// +// poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { +// return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { +// poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) +// +// for _, node := range []*mock2.Node{node0, node1, node2, node3} { +// if node.Validator { +// poa.AddAccount(node.AccountID, node.Name) +// } +// } +// poa.SetOnline("node0", "node1", "node2", "node3") +// +// return poa +// }) +// } +// +// nodeOptions := make(map[string][]options.Option[protocol.Protocol]) +// for _, node := range ts.Nodes() { +// nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ +// protocol.WithChainManagerOptions( +// chainmanager.WithCommitmentRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), +// ), +// ), +// protocol.WithSybilProtectionProvider( +// sybilprotectionv1.NewProvider( +// sybilprotectionv1.WithSeatManagerProvider( +// poaProvider(), +// ), +// ), +// ), +// protocol.WithEngineOptions( +// engine.WithBlockRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), +// ), +// ), +// protocol.WithStorageOptions( +// storage.WithPruningDelay(20), +// ), +// } +// } +// +// ts.Run(false, nodeOptions) +// +// // Verify that nodes have the expected states. +// +// expectedCommittee := []iotago.AccountID{ +// node0.AccountID, +// node1.AccountID, +// node2.AccountID, +// node3.AccountID, +// } +// expectedOnlineCommitteeFull := []account.SeatIndex{ +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), +// } +// +// expectedOnlineCommitteeHalf := []account.SeatIndex{ +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), +// } +// +// for _, node := range ts.Nodes() { +// node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") +// } +// +// { +// genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) +// genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithSnapshotImported(true), +// testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), +// testsuite.WithLatestCommitment(genesisCommitment), +// testsuite.WithLatestFinalizedSlot(0), +// testsuite.WithChainID(genesisCommitment.MustID()), +// testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), +// +// testsuite.WithSybilProtectionCommittee(0, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(0), +// testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), +// testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), +// ) +// } +// +// // Issue up to slot 11 - just before committee selection for the next epoch. +// // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(8), +// testsuite.WithLatestCommitmentSlotIndex(9), +// testsuite.WithEqualStoredCommitmentAtIndex(9), +// testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(9, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(9), +// ) +// +// for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { +// var attestationBlocks []*blocks.Block +// for _, node := range ts.Nodes() { +// if node.Validator { +// attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) +// } +// } +// ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) +// } +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// // Update online committee. +// for _, node := range ts.Nodes() { +// manualPOA := node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA) +// manualPOA.SetOnline("node0", "node1") +// manualPOA.SetOffline("node2", "node3") +// } +// +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15, 16, 17, 18, 19}, 4, "P0:11.3", []*mock2.Node{node0, node1}, true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(8), +// testsuite.WithLatestCommitmentSlotIndex(17), +// testsuite.WithEqualStoredCommitmentAtIndex(17), +// testsuite.WithLatestCommitmentCumulativeWeight(50), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(17, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeHalf...), +// testsuite.WithEvictedSlot(17), +// ) +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(15) +// require.NoError(t, err) +// +// // Assert state of the forked engine after rollback. +// { +// require.EqualValues(t, 15, newEngine.Storage.Settings().LatestCommitment().Slot()) +// require.EqualValues(t, 8, newEngine.Storage.Settings().LatestFinalizedSlot()) +// require.EqualValues(t, 15, newEngine.EvictionState.LastEvictedSlot()) +// +// for epoch := 0; epoch <= 2; epoch++ { +// committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) +// require.NoError(t, err) +// require.Len(t, committeeEpoch.IDs(), 4) +// } +// +// // Commmittee for the future epoch does not exist. +// committeeEpoch3, err := newEngine.Storage.Committee().Load(3) +// require.NoError(t, err) +// require.Nil(t, committeeEpoch3) +// +// for slot := 1; slot <= 15; slot++ { +// copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) +// } +// +// // Commitment for the first slot after the fork does not exist. +// _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(16)) +// require.Error(t, err) +// } +//} +// +//func TestProtocol_EngineRollbackNoFinalizationBeforePointOfNoReturn(t *testing.T) { +// ts := testsuite.NewTestSuite(t, +// testsuite.WithLivenessThresholdLowerBound(10), +// testsuite.WithLivenessThresholdUpperBound(10), +// testsuite.WithMinCommittableAge(2), +// testsuite.WithMaxCommittableAge(3), +// testsuite.WithEpochNearingThreshold(5), +// testsuite.WithSlotsPerEpochExponent(3), +// testsuite.WithGenesisTimestampOffset(1000*10), +// +// testsuite.WithWaitFor(15*time.Second), +// ) +// defer ts.Shutdown() +// +// node0 := ts.AddValidatorNode("node0") +// node1 := ts.AddValidatorNode("node1") +// node2 := ts.AddValidatorNode("node2") +// node3 := ts.AddValidatorNode("node3") +// +// poaProvider := func() module.Provider[*engine.Engine, seatmanager.SeatManager] { +// return module.Provide(func(e *engine.Engine) seatmanager.SeatManager { +// poa := mock.NewManualPOAProvider()(e).(*mock.ManualPOA) +// +// for _, node := range []*mock2.Node{node0, node1, node2, node3} { +// if node.Validator { +// poa.AddAccount(node.AccountID, node.Name) +// } +// } +// poa.SetOnline("node0", "node1", "node2", "node3") +// +// return poa +// }) +// } +// +// nodeOptions := make(map[string][]options.Option[protocol.Protocol]) +// for _, node := range ts.Nodes() { +// nodeOptions[node.Name] = []options.Option[protocol.Protocol]{ +// protocol.WithChainManagerOptions( +// chainmanager.WithCommitmentRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.CommitmentID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.CommitmentID](500*time.Millisecond), +// ), +// ), +// protocol.WithSybilProtectionProvider( +// sybilprotectionv1.NewProvider( +// sybilprotectionv1.WithSeatManagerProvider( +// poaProvider(), +// ), +// ), +// ), +// protocol.WithEngineOptions( +// engine.WithBlockRequesterOptions( +// eventticker.RetryInterval[iotago.SlotIndex, iotago.BlockID](1*time.Second), +// eventticker.RetryJitter[iotago.SlotIndex, iotago.BlockID](500*time.Millisecond), +// ), +// ), +// protocol.WithStorageOptions( +// storage.WithPruningDelay(20), +// ), +// } +// } +// +// ts.Run(false, nodeOptions) +// +// // Verify that nodes have the expected states. +// +// expectedCommittee := []iotago.AccountID{ +// node0.AccountID, +// node1.AccountID, +// node2.AccountID, +// node3.AccountID, +// } +// expectedOnlineCommitteeFull := []account.SeatIndex{ +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node2.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node3.AccountID)), +// } +// +// expectedOnlineCommitteeHalf := []account.SeatIndex{ +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node0.AccountID)), +// lo.Return1(node0.Protocol.MainEngineInstance().SybilProtection.SeatManager().Committee(1).GetSeat(node1.AccountID)), +// } +// +// for _, node := range ts.Nodes() { +// node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA).SetOnline("node0", "node1", "node2", "node3") +// } +// +// { +// genesisCommitment := iotago.NewEmptyCommitment(ts.API.ProtocolParameters().Version()) +// genesisCommitment.ReferenceManaCost = ts.API.ProtocolParameters().CongestionControlParameters().MinReferenceManaCost +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithSnapshotImported(true), +// testsuite.WithProtocolParameters(ts.API.ProtocolParameters()), +// testsuite.WithLatestCommitment(genesisCommitment), +// testsuite.WithLatestFinalizedSlot(0), +// testsuite.WithChainID(genesisCommitment.MustID()), +// testsuite.WithStorageCommitments([]*iotago.Commitment{genesisCommitment}), +// +// testsuite.WithSybilProtectionCommittee(0, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(0), +// testsuite.WithActiveRootBlocks(ts.Blocks("Genesis")), +// testsuite.WithStorageRootBlocks(ts.Blocks("Genesis")), +// ) +// } +// +// // Issue up to slot 11 - just before committee selection for the next epoch. +// // Committee will be reused at slot 10 is finalized or slot 12 is committed, whichever happens first. +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 4, "Genesis", ts.Nodes(), true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(8), +// testsuite.WithLatestCommitmentSlotIndex(9), +// testsuite.WithEqualStoredCommitmentAtIndex(9), +// testsuite.WithLatestCommitmentCumulativeWeight(28), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(9, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeFull...), +// testsuite.WithEvictedSlot(9), +// ) +// +// for _, slot := range []iotago.SlotIndex{4, 5, 6, 7, 8, 9} { +// var attestationBlocks []*blocks.Block +// for _, node := range ts.Nodes() { +// if node.Validator { +// attestationBlocks = append(attestationBlocks, ts.Block(fmt.Sprintf("P0:%d.3-%s", slot, node.Name))) +// } +// } +// ts.AssertAttestationsForSlot(slot, attestationBlocks, ts.Nodes()...) +// } +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// // Update online committee. +// for _, node := range ts.Nodes() { +// manualPOA := node.Protocol.MainEngineInstance().SybilProtection.SeatManager().(*mock.ManualPOA) +// manualPOA.SetOnline("node0", "node1") +// manualPOA.SetOffline("node2", "node3") +// } +// +// { +// ts.IssueBlocksAtSlots("P0:", []iotago.SlotIndex{12, 13, 14, 15}, 4, "P0:11.3", []*mock2.Node{node0, node1}, true, nil) +// +// ts.AssertNodeState(ts.Nodes(), +// testsuite.WithLatestFinalizedSlot(8), +// testsuite.WithLatestCommitmentSlotIndex(13), +// testsuite.WithEqualStoredCommitmentAtIndex(13), +// testsuite.WithLatestCommitmentCumulativeWeight(42), // 7 for each slot starting from 4 +// testsuite.WithSybilProtectionCommittee(13, expectedCommittee), +// testsuite.WithSybilProtectionOnlineCommittee(expectedOnlineCommitteeHalf...), +// testsuite.WithEvictedSlot(13), +// ) +// +// ts.AssertBlocksExist(ts.BlocksWithPrefix("P0"), true, ts.Nodes()...) +// } +// +// newEngine, err := node3.Protocol.EngineManager.ForkEngineAtSlot(9) +// require.NoError(t, err) +// +// // Assert state of the forked engine after rollback. +// { +// require.EqualValues(t, 9, newEngine.Storage.Settings().LatestCommitment().Slot()) +// require.EqualValues(t, 8, newEngine.Storage.Settings().LatestFinalizedSlot()) +// require.EqualValues(t, 9, newEngine.EvictionState.LastEvictedSlot()) +// +// for epoch := 0; epoch <= 1; epoch++ { +// committeeEpoch, err := newEngine.Storage.Committee().Load(iotago.EpochIndex(epoch)) +// require.NoError(t, err) +// require.Len(t, committeeEpoch.IDs(), 4) +// } +// +// // Commmittee for the future epoch does not exist. +// committeeEpoch2, err := newEngine.Storage.Committee().Load(2) +// require.NoError(t, err) +// require.Nil(t, committeeEpoch2) +// +// for slot := 1; slot <= 9; slot++ { +// copiedCommitment, err := newEngine.Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// sourceCommitment, err := node1.Protocol.MainEngineInstance().Storage.Commitments().Load(iotago.SlotIndex(slot)) +// require.NoError(t, err) +// require.Equal(t, sourceCommitment.ID(), copiedCommitment.ID()) +// } +// +// // Commitment for the first slot after the fork does not exist. +// _, err = newEngine.Storage.Commitments().Load(iotago.SlotIndex(10)) +// require.Error(t, err) +// } +//} +// +//// TODO: test fork before point of no return (slot 12) +//// TODO: test fork on last slot of an epoch (slot 15) diff --git a/tools/evil-spammer/go.mod b/tools/evil-spammer/go.mod index 1bf9c21c4..2a7439e08 100644 --- a/tools/evil-spammer/go.mod +++ b/tools/evil-spammer/go.mod @@ -8,13 +8,13 @@ replace github.com/iotaledger/iota-core/tools/genesis-snapshot => ../genesis-sna require ( github.com/AlecAivazis/survey/v2 v2.3.7 - github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 + github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 github.com/iotaledger/iota-core/tools/genesis-snapshot v0.0.0-00010101000000-000000000000 github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c @@ -37,12 +37,13 @@ require ( github.com/holiman/uint256 v1.2.3 // 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-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 // indirect + github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect diff --git a/tools/evil-spammer/go.sum b/tools/evil-spammer/go.sum index 6b2afa47f..61ed0b5f8 100644 --- a/tools/evil-spammer/go.sum +++ b/tools/evil-spammer/go.sum @@ -169,32 +169,34 @@ 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-20230928074706-d58e32f86729 h1:HHxgNhbtD6WDCwSQBbPrQe8c4ZNjNi0KcgCJo0nm9bY= -github.com/iotaledger/hive.go/ads v0.0.0-20230928074706-d58e32f86729/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= -github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729 h1:rBADf+IZDKkDOuZznwIdonxF9jcOSQJU/qOYSNInX84= -github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729/go.mod h1:eiZgbcwTDZ7d9hEait2EAwAhixWhceW4MXmuVk2EcEw= -github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729 h1:PQ9TFyXBrV6LLTOzE43CV/vz+ItN5v6lcA7ms0YOvcE= -github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 h1:mwIZhduBiOD4rG4hqrPhW616EU1wX4eD2zHu26be5Yc= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729 h1:FpFlPNOHcvHDyk1gN3OuL/hgvTKVsc5IN+q8U1YF9P4= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 h1:hHdIZn95+HdP1JdjV8TAsuL5kU4eb4gncehyjXo/feQ= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 h1:+/OtOAx2tMy8ER3XBt9RpnspWyDrVqW6kQGAd24jT0k= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 h1:XCYvP8XwETTXF5LNz8q9X3EajDut7+UwTwqJ2TQ0TJo= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 h1:hW4r9no+03ufp2fyx4IjTFwINkEz3OI3LqvSjv7SJ1c= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= -github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729 h1:FOQetJY2scpCtCGrZQWGw3RwB3lRIDdyu+M6P1NACM4= -github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 h1:4aRR9UG4dHpdlTcMN1Px++eaxlGXXk1n6co8t/WlchM= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 h1:mPmP3/0XJAf0ZkCzQenpoQPMv+m56Z8+A1i/UO18Hdw= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 h1:gZlIK1OzdA3aZ78PsiWe3poVzawyw4S3zboMHE1TrY0= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d h1:VLGhDCBxGNKq+ueqsZN+abBTKIHxm8tSWUL7OfJHcNw= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= +github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d h1:oI57ETG+XsCYbYBpbJT3k06ixPUv0gTdzBqf84ohkRo= +github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d/go.mod h1:eiZgbcwTDZ7d9hEait2EAwAhixWhceW4MXmuVk2EcEw= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d h1:bZXrxulDoDBsNg0wtXowrAyltjfgZahiGYuAoS5GKU4= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d h1:pRcB0wfWAlfDJ10ZZ6LK1ukRXcPaL299LLU/zbYWnsQ= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d h1:Vn8BY/hLTcKJWh8LCw6PDTbCK2562wq93MPynV1pHjE= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d h1:bTBfkwg5UOZrj/13N/YZyi3RYJjNwSpjKfkJdqvz5OU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d h1:tmaZvkBCP/OrQrwC728AEFtRAW8YUHBVNE8IXxtd4C4= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d h1:CxOlK2QbijArZTHNwB1wR03wcW2qCzqCyoc9MFWE5L8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d h1:qNmg1DUvge8zPvygQEoulQjLG7gFzWKqPMJ3r7ZESm0= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d h1:u8pGLFhi7LnFOqqt3Q2buC3UjKX5l4e8bJ4wMjAU+Rg= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d/go.mod h1:UF7PzlWdZ2H0Hkxrt4AgJmNVeMXUJzw4RwbHpib1DB0= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d h1:BpfdehuhnIsl2VtPOSnhKYAbLx8rSeyODz5TJ7kRTfw= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d h1:mn2Gax95UuUpuzEi4osLk+1IBjv5q56LwcxF/lAxk38= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d h1:1839CFkegKrSvTfWkgYHpH1pudehOXxX05Mzy1KSR7I= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d h1:ekHWRypoaiCXgrJVUQS7rCewsK3FuG1gTbPxu5jYn9c= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c h1:faTwv2r4EZ6FixcFtaSD5M02YRm+/kmQKsLBsYSJl3I= github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c/go.mod h1:wR9xBbsofns9hFyRHFZ2bDYIb861qsfmQPVMBKcPvDo= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= diff --git a/tools/gendoc/go.mod b/tools/gendoc/go.mod index 159e19742..39a9ddd2b 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-20230928074706-d58e32f86729 + github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d 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 @@ -58,18 +57,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-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 // indirect + github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d // indirect github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230927140518-622f63be6182 // indirect github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230927140257-bfa0bb0af2bd // indirect github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c // indirect @@ -134,7 +134,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.16.0 // indirect @@ -150,7 +149,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 @@ -180,6 +178,5 @@ require ( google.golang.org/grpc v1.58.2 // 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 8a69e6b1b..b8dc01264 100644 --- a/tools/gendoc/go.sum +++ b/tools/gendoc/go.sum @@ -279,34 +279,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-20230928074706-d58e32f86729 h1:HHxgNhbtD6WDCwSQBbPrQe8c4ZNjNi0KcgCJo0nm9bY= -github.com/iotaledger/hive.go/ads v0.0.0-20230928074706-d58e32f86729/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= -github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729 h1:rBADf+IZDKkDOuZznwIdonxF9jcOSQJU/qOYSNInX84= -github.com/iotaledger/hive.go/app v0.0.0-20230928074706-d58e32f86729/go.mod h1:eiZgbcwTDZ7d9hEait2EAwAhixWhceW4MXmuVk2EcEw= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d h1:VLGhDCBxGNKq+ueqsZN+abBTKIHxm8tSWUL7OfJHcNw= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= +github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d h1:oI57ETG+XsCYbYBpbJT3k06ixPUv0gTdzBqf84ohkRo= +github.com/iotaledger/hive.go/app v0.0.0-20230929122509-67f34bfed40d/go.mod h1:eiZgbcwTDZ7d9hEait2EAwAhixWhceW4MXmuVk2EcEw= 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-20230928074706-d58e32f86729 h1:PQ9TFyXBrV6LLTOzE43CV/vz+ItN5v6lcA7ms0YOvcE= -github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 h1:mwIZhduBiOD4rG4hqrPhW616EU1wX4eD2zHu26be5Yc= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729 h1:FpFlPNOHcvHDyk1gN3OuL/hgvTKVsc5IN+q8U1YF9P4= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 h1:hHdIZn95+HdP1JdjV8TAsuL5kU4eb4gncehyjXo/feQ= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 h1:+/OtOAx2tMy8ER3XBt9RpnspWyDrVqW6kQGAd24jT0k= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 h1:XCYvP8XwETTXF5LNz8q9X3EajDut7+UwTwqJ2TQ0TJo= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 h1:hW4r9no+03ufp2fyx4IjTFwINkEz3OI3LqvSjv7SJ1c= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= -github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729 h1:FOQetJY2scpCtCGrZQWGw3RwB3lRIDdyu+M6P1NACM4= -github.com/iotaledger/hive.go/logger v0.0.0-20230928074706-d58e32f86729/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 h1:4aRR9UG4dHpdlTcMN1Px++eaxlGXXk1n6co8t/WlchM= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 h1:mPmP3/0XJAf0ZkCzQenpoQPMv+m56Z8+A1i/UO18Hdw= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 h1:gZlIK1OzdA3aZ78PsiWe3poVzawyw4S3zboMHE1TrY0= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d h1:bZXrxulDoDBsNg0wtXowrAyltjfgZahiGYuAoS5GKU4= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d h1:pRcB0wfWAlfDJ10ZZ6LK1ukRXcPaL299LLU/zbYWnsQ= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d h1:Vn8BY/hLTcKJWh8LCw6PDTbCK2562wq93MPynV1pHjE= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d h1:bTBfkwg5UOZrj/13N/YZyi3RYJjNwSpjKfkJdqvz5OU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d h1:tmaZvkBCP/OrQrwC728AEFtRAW8YUHBVNE8IXxtd4C4= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d h1:CxOlK2QbijArZTHNwB1wR03wcW2qCzqCyoc9MFWE5L8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d h1:qNmg1DUvge8zPvygQEoulQjLG7gFzWKqPMJ3r7ZESm0= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d h1:u8pGLFhi7LnFOqqt3Q2buC3UjKX5l4e8bJ4wMjAU+Rg= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d/go.mod h1:UF7PzlWdZ2H0Hkxrt4AgJmNVeMXUJzw4RwbHpib1DB0= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d h1:BpfdehuhnIsl2VtPOSnhKYAbLx8rSeyODz5TJ7kRTfw= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d h1:mn2Gax95UuUpuzEi4osLk+1IBjv5q56LwcxF/lAxk38= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d h1:1839CFkegKrSvTfWkgYHpH1pudehOXxX05Mzy1KSR7I= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d h1:ekHWRypoaiCXgrJVUQS7rCewsK3FuG1gTbPxu5jYn9c= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230927140518-622f63be6182 h1:lQiktl3Q0B+cHbVum7WzJikOEP+buw686oSrw5Unyz8= github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230927140518-622f63be6182/go.mod h1:q24QEsS887ZWJVX76w2kwSgC84KS7wIKOy1otuqZ2ZM= github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230927140257-bfa0bb0af2bd h1:nFG3Zq/zFA4KhBYFX2IezX1C74zfE0DqCt0LrgTa9Ig= diff --git a/tools/genesis-snapshot/go.mod b/tools/genesis-snapshot/go.mod index 43f5de5bf..c35546839 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-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 - github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 + github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d + github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c github.com/mr-tron/base58 v1.2.0 @@ -27,13 +27,15 @@ require ( github.com/holiman/uint256 v1.2.3 // 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-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 // indirect + github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d // indirect + github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d // 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 @@ -59,6 +61,8 @@ require ( github.com/wollac/iota-crypto-demo v0.0.0-20221117162917-b10619eccb98 // indirect github.com/zyedidia/generic v1.2.1 // indirect go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect golang.org/x/sys v0.12.0 // indirect google.golang.org/protobuf v1.31.0 // indirect diff --git a/tools/genesis-snapshot/go.sum b/tools/genesis-snapshot/go.sum index ef08c5fab..61b00b601 100644 --- a/tools/genesis-snapshot/go.sum +++ b/tools/genesis-snapshot/go.sum @@ -28,28 +28,32 @@ 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-20230928074706-d58e32f86729 h1:HHxgNhbtD6WDCwSQBbPrQe8c4ZNjNi0KcgCJo0nm9bY= -github.com/iotaledger/hive.go/ads v0.0.0-20230928074706-d58e32f86729/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= -github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729 h1:PQ9TFyXBrV6LLTOzE43CV/vz+ItN5v6lcA7ms0YOvcE= -github.com/iotaledger/hive.go/constraints v0.0.0-20230928074706-d58e32f86729/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729 h1:mwIZhduBiOD4rG4hqrPhW616EU1wX4eD2zHu26be5Yc= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230928074706-d58e32f86729/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729 h1:FpFlPNOHcvHDyk1gN3OuL/hgvTKVsc5IN+q8U1YF9P4= -github.com/iotaledger/hive.go/crypto v0.0.0-20230928074706-d58e32f86729/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729 h1:hHdIZn95+HdP1JdjV8TAsuL5kU4eb4gncehyjXo/feQ= -github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729 h1:+/OtOAx2tMy8ER3XBt9RpnspWyDrVqW6kQGAd24jT0k= -github.com/iotaledger/hive.go/ierrors v0.0.0-20230928074706-d58e32f86729/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729 h1:XCYvP8XwETTXF5LNz8q9X3EajDut7+UwTwqJ2TQ0TJo= -github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729 h1:hW4r9no+03ufp2fyx4IjTFwINkEz3OI3LqvSjv7SJ1c= -github.com/iotaledger/hive.go/lo v0.0.0-20230928074706-d58e32f86729/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729 h1:4aRR9UG4dHpdlTcMN1Px++eaxlGXXk1n6co8t/WlchM= -github.com/iotaledger/hive.go/runtime v0.0.0-20230928074706-d58e32f86729/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729 h1:mPmP3/0XJAf0ZkCzQenpoQPMv+m56Z8+A1i/UO18Hdw= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230928074706-d58e32f86729/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729 h1:gZlIK1OzdA3aZ78PsiWe3poVzawyw4S3zboMHE1TrY0= -github.com/iotaledger/hive.go/stringify v0.0.0-20230928074706-d58e32f86729/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d h1:VLGhDCBxGNKq+ueqsZN+abBTKIHxm8tSWUL7OfJHcNw= +github.com/iotaledger/hive.go/ads v0.0.0-20230929122509-67f34bfed40d/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d h1:bZXrxulDoDBsNg0wtXowrAyltjfgZahiGYuAoS5GKU4= +github.com/iotaledger/hive.go/constraints v0.0.0-20230929122509-67f34bfed40d/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d h1:pRcB0wfWAlfDJ10ZZ6LK1ukRXcPaL299LLU/zbYWnsQ= +github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230929122509-67f34bfed40d/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d h1:Vn8BY/hLTcKJWh8LCw6PDTbCK2562wq93MPynV1pHjE= +github.com/iotaledger/hive.go/crypto v0.0.0-20230929122509-67f34bfed40d/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d h1:bTBfkwg5UOZrj/13N/YZyi3RYJjNwSpjKfkJdqvz5OU= +github.com/iotaledger/hive.go/ds v0.0.0-20230929122509-67f34bfed40d/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d h1:tmaZvkBCP/OrQrwC728AEFtRAW8YUHBVNE8IXxtd4C4= +github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d h1:CxOlK2QbijArZTHNwB1wR03wcW2qCzqCyoc9MFWE5L8= +github.com/iotaledger/hive.go/kvstore v0.0.0-20230929122509-67f34bfed40d/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d h1:qNmg1DUvge8zPvygQEoulQjLG7gFzWKqPMJ3r7ZESm0= +github.com/iotaledger/hive.go/lo v0.0.0-20230929122509-67f34bfed40d/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d h1:u8pGLFhi7LnFOqqt3Q2buC3UjKX5l4e8bJ4wMjAU+Rg= +github.com/iotaledger/hive.go/log v0.0.0-20230929122509-67f34bfed40d/go.mod h1:UF7PzlWdZ2H0Hkxrt4AgJmNVeMXUJzw4RwbHpib1DB0= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d h1:BpfdehuhnIsl2VtPOSnhKYAbLx8rSeyODz5TJ7kRTfw= +github.com/iotaledger/hive.go/logger v0.0.0-20230929122509-67f34bfed40d/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d h1:mn2Gax95UuUpuzEi4osLk+1IBjv5q56LwcxF/lAxk38= +github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d h1:1839CFkegKrSvTfWkgYHpH1pudehOXxX05Mzy1KSR7I= +github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230929122509-67f34bfed40d/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d h1:ekHWRypoaiCXgrJVUQS7rCewsK3FuG1gTbPxu5jYn9c= +github.com/iotaledger/hive.go/stringify v0.0.0-20230929122509-67f34bfed40d/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c h1:faTwv2r4EZ6FixcFtaSD5M02YRm+/kmQKsLBsYSJl3I= github.com/iotaledger/iota.go/v4 v4.0.0-20230929090257-1620d009ba8c/go.mod h1:wR9xBbsofns9hFyRHFZ2bDYIb861qsfmQPVMBKcPvDo= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= @@ -109,6 +113,7 @@ 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= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -120,6 +125,12 @@ github.com/zyedidia/generic v1.2.1 h1:Zv5KS/N2m0XZZiuLS82qheRG4X1o5gsWreGb0hR7XD github.com/zyedidia/generic v1.2.1/go.mod h1:ly2RBz4mnz1yeuVbQA/VFwGjK3mnHGRj1JuoG336Bis= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ=