Skip to content

Commit

Permalink
Fix: fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Oct 5, 2023
1 parent ef2e6da commit eb6a8a0
Show file tree
Hide file tree
Showing 14 changed files with 226 additions and 205 deletions.
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +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-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-20230928074706-d58e32f86729
github.com/iotaledger/hive.go/ierrors v0.0.0-20230929122509-67f34bfed40d
github.com/iotaledger/hive.go/kvstore v0.0.0-20230928074706-d58e32f86729
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-20230928074706-d58e32f86729
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/hive.go/ads v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/app v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/constraints v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231005070803-455595bf0a07
github.com/iotaledger/hive.go/crypto v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/ds v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/ierrors v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/kvstore v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/lo v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/log v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/logger v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/runtime v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231005070803-455595bf0a07
github.com/iotaledger/hive.go/stringify v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951
github.com/iotaledger/iota.go/v4 v4.0.0-20231003181920-a3245ad7a737
Expand Down
56 changes: 28 additions & 28 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -275,34 +275,34 @@ github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJ
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys=
github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw=
github.com/iotaledger/hive.go/ads v0.0.0-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-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-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-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-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-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-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-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/hive.go/ads v0.0.0-20231005070803-455595bf0a07 h1:H4ZVd8iS1+/+6kN1FCvWlrJerWvaGv0N0YVTOTiKLAM=
github.com/iotaledger/hive.go/ads v0.0.0-20231005070803-455595bf0a07/go.mod h1:IAWZ/5It5P8B41mWyJXJVcG0vuikVRaTFKQnr2D2q+c=
github.com/iotaledger/hive.go/app v0.0.0-20231005070803-455595bf0a07 h1:7+7xSAiLQcrAQTjE9CiGwdwA4tApi6MOl1uR8TT37rc=
github.com/iotaledger/hive.go/app v0.0.0-20231005070803-455595bf0a07/go.mod h1:eiZgbcwTDZ7d9hEait2EAwAhixWhceW4MXmuVk2EcEw=
github.com/iotaledger/hive.go/constraints v0.0.0-20231005070803-455595bf0a07 h1:vRIm5NAvCsg3oTHLjjJyPv0J4hR81ceLMSL0s3aNUaQ=
github.com/iotaledger/hive.go/constraints v0.0.0-20231005070803-455595bf0a07/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231005070803-455595bf0a07 h1:Qz1w42u8um1f8VWp7ivWSFAny0uQ5WQtC5AIo8wXY/s=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231005070803-455595bf0a07/go.mod h1:jn3TNmiNRIiQm/rS4VD+7wFHI2+UXABHvCA3PbQxBqI=
github.com/iotaledger/hive.go/crypto v0.0.0-20231005070803-455595bf0a07 h1:mbpeBB2UJ8P8yu3R/cT3pXnUhx+ElcsVHehi9bczQ20=
github.com/iotaledger/hive.go/crypto v0.0.0-20231005070803-455595bf0a07/go.mod h1:jP68na941d9uq7RtnA8aQ/FtIGRGz/51cU4uXrInQFU=
github.com/iotaledger/hive.go/ds v0.0.0-20231005070803-455595bf0a07 h1:gnNS6hOQZu4TxaaruFkunKSZHIAq4rdNcHf0DsLUhDk=
github.com/iotaledger/hive.go/ds v0.0.0-20231005070803-455595bf0a07/go.mod h1:ZrqsjIJS2QCgGp7Ki+l4hWJQgzfBObUCemb5Upwlx18=
github.com/iotaledger/hive.go/ierrors v0.0.0-20231005070803-455595bf0a07 h1:c+0LxjcZRXQ2T4jiSILMhrZ89xVJyX1LeJF6bc3co3U=
github.com/iotaledger/hive.go/ierrors v0.0.0-20231005070803-455595bf0a07/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8=
github.com/iotaledger/hive.go/kvstore v0.0.0-20231005070803-455595bf0a07 h1:U9KAiWKERLvkbCBf3ZDFsGIguC+5j5jRkQ9tePU5qik=
github.com/iotaledger/hive.go/kvstore v0.0.0-20231005070803-455595bf0a07/go.mod h1:DeP4JF4N995LteD0+/o7NsW1bO5IXURIJ27A69Ca5+Y=
github.com/iotaledger/hive.go/lo v0.0.0-20231005070803-455595bf0a07 h1:mZLvI/U82VXm8Y++eOzd1SUicHaTVErXMJrtpnvmnno=
github.com/iotaledger/hive.go/lo v0.0.0-20231005070803-455595bf0a07/go.mod h1:4oKCdMEhHMLCudBz79kuvJmgSY/DhfVePNIyJhew/80=
github.com/iotaledger/hive.go/log v0.0.0-20231005070803-455595bf0a07 h1:gQJyN3MRrOvyzpzudiCsov+JjPCbyWMky8g4DM4Hm8U=
github.com/iotaledger/hive.go/log v0.0.0-20231005070803-455595bf0a07/go.mod h1:UF7PzlWdZ2H0Hkxrt4AgJmNVeMXUJzw4RwbHpib1DB0=
github.com/iotaledger/hive.go/logger v0.0.0-20231005070803-455595bf0a07 h1:L1cWRwR7J0dzESq9YsxC76P+EJ0bDbIWElUEbhtoip4=
github.com/iotaledger/hive.go/logger v0.0.0-20231005070803-455595bf0a07/go.mod h1:sxqWRdZ1OOxwkxVczuGcW034Mpt2vFh5ebJHO++ZYeI=
github.com/iotaledger/hive.go/runtime v0.0.0-20231005070803-455595bf0a07 h1:FrMRe10E5WQfglfcn2SH6zIUKvL2oGAdeWn8Nxv4AAE=
github.com/iotaledger/hive.go/runtime v0.0.0-20231005070803-455595bf0a07/go.mod h1:fXVyQ1MAwxe/EmjAnG8WcQqbzGk9EW/FsJ/n16H/f/w=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231005070803-455595bf0a07 h1:HvLxAdbqAlc4kFWILLaOHOdxi2dUyhE+3APHablEqEE=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231005070803-455595bf0a07/go.mod h1:IJgaaxbgKCsNat18jlJJEAxCY2oVYR3F30B+M4vJ89I=
github.com/iotaledger/hive.go/stringify v0.0.0-20231005070803-455595bf0a07 h1:rudCl0AX255wyTIZM+MLhk19lgxcpYku9IkLexlK/4U=
github.com/iotaledger/hive.go/stringify v0.0.0-20231005070803-455595bf0a07/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e h1:Mwoe7M6gI2DAjJIXmIskgnI8KdxCY1LyEEhtJCNYBsU=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231001095511-32be422a567e/go.mod h1:jhzexR5X8m6qcmrwt5OX477O/ZwT7Ak9sPT83ByPkAo=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231001095356-923e8f138951 h1:qUf1W0fE1IyZzVy3Exv0Kj+SKECXG3S26c9m2ETb07U=
Expand Down
47 changes: 24 additions & 23 deletions pkg/protocol/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,41 +195,42 @@ func (c *Chains) initChainSwitching() {

c.HeaviestVerifiedChain.OnUpdate(func(_, heaviestVerifiedChain *Chain) {
c.MainChain.Set(heaviestVerifiedChain)

heaviestVerifiedChain.ForkingPoint.Get().IsRoot.Trigger()
})
}

func (c *Chains) provideEngineIfRequested(chain *Chain) func() {
return chain.InstantiateEngine.OnUpdate(func(_, instantiate bool) {
if !instantiate {
chain.SpawnedEngine.Set(nil)
// TODO: MOVE TO WORKERPOOL
go func() {
if !instantiate {
chain.SpawnedEngine.Set(nil)

return
}

if currentEngine := chain.Engine.Get(); currentEngine == nil {
mainEngine, err := c.engineManager.LoadActiveEngine(c.protocol.options.SnapshotPath)
if err != nil {
panic(fmt.Sprintf("could not load active engine: %s", err))
return
}

chain.SpawnedEngine.Set(mainEngine)
if currentEngine := chain.Engine.Get(); currentEngine == nil {
mainEngine, err := c.engineManager.LoadActiveEngine(c.protocol.options.SnapshotPath)
if err != nil {
panic(fmt.Sprintf("could not load active engine: %s", err))
}

chain.SpawnedEngine.Set(mainEngine)

c.protocol.Network.HookStopped(mainEngine.Shutdown)
} else {
forkingPoint := chain.ForkingPoint.Get()
snapshotTargetSlot := forkingPoint.Slot() - 1
c.protocol.Network.HookStopped(mainEngine.Shutdown)
} else {
forkingPoint := chain.ForkingPoint.Get()
snapshotTargetSlot := forkingPoint.Slot() - 1

candidateEngineInstance, err := c.engineManager.ForkEngineAtSlot(snapshotTargetSlot)
if err != nil {
panic(ierrors.Wrap(err, "error creating new candidate engine"))
}
candidateEngineInstance, err := c.engineManager.ForkEngineAtSlot(snapshotTargetSlot)
if err != nil {
panic(ierrors.Wrap(err, "error creating new candidate engine"))
}

chain.SpawnedEngine.Set(candidateEngineInstance)
chain.SpawnedEngine.Set(candidateEngineInstance)

c.protocol.Network.HookStopped(candidateEngineInstance.Shutdown)
}
c.protocol.Network.HookStopped(candidateEngineInstance.Shutdown)
}
}()
})
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/protocol/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ func (c *Commitment) inheritChain(parent *Commitment) func(*Commitment, *Commitm

return func(_, mainChild *Commitment) {
c.SpawnedChain.Compute(func(spawnedChain *Chain) (newSpawnedChain *Chain) {
if c.IsRoot.WasTriggered() {
return spawnedChain
}

switch mainChild {
case nil:
panic("main child may not be changed to nil")
Expand Down Expand Up @@ -219,6 +223,7 @@ func (c *Commitment) promote(targetChain *Chain) {
// root commitment of the main chain that is the first commitment ever published (which means that we can just
// set the chain that we want it to have)
c.Chain.Set(targetChain)
c.SpawnedChain.Set(targetChain)
} else if parent := c.Parent.Get(); parent.Chain.Get() == targetChain {
parent.MainChild.Set(c)
}
Expand Down
7 changes: 6 additions & 1 deletion pkg/protocol/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/iotaledger/hive.go/runtime/options"
"github.com/iotaledger/hive.go/runtime/workerpool"
"github.com/iotaledger/iota-core/pkg/network"
"github.com/iotaledger/iota-core/pkg/protocol/engine"
iotago "github.com/iotaledger/iota.go/v4"
)

Expand Down Expand Up @@ -38,7 +39,11 @@ func New(logger log.Logger, workers *workerpool.Group, dispatcher network.Endpoi
}

func (p *Protocol) Run(ctx context.Context) error {
p.TriggerInitialized()
p.MainChain.OnUpdateOnce(func(_, mainChain *Chain) {
mainChain.Engine.OnUpdateOnce(func(_, _ *engine.Engine) {
p.TriggerInitialized()
})
})

<-ctx.Done()

Expand Down
10 changes: 5 additions & 5 deletions pkg/tests/protocol_engine_switching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,17 @@ func TestProtocol_EngineSwitching(t *testing.T) {
node8.IssueActivity(ctxP2, wg, 21)

// P1 finalized until slot 18. We do not expect any forks here because our CW is higher than the other partition's.
ts.AssertForkDetectedCount(1, nodesP1...)
ts.AssertForkDetectedCount(0, nodesP1...)
// P1's chain is heavier, they should not consider switching the chain.
ts.AssertCandidateEngineActivatedCount(1, nodesP1...)
ts.AssertCandidateEngineActivatedCount(0, nodesP1...)
ctxP2Cancel() // we can stop issuing on P2.

// Nodes from P2 should switch the chain.
ts.AssertForkDetectedCount(2, nodesP2...)
ts.AssertCandidateEngineActivatedCount(2, nodesP2...)
ts.AssertForkDetectedCount(1, nodesP2...)
ts.AssertCandidateEngineActivatedCount(1, nodesP2...)

// Here we need to let enough time pass for the nodes to sync up the candidate engines and switch them
ts.AssertMainEngineSwitchedCount(2, nodesP2...)
ts.AssertMainEngineSwitchedCount(1, nodesP2...)

// Make sure that nodes that switched their engine still have blocks with prefix P0 from before the fork.
// Those nodes should also have all the blocks from the target fork P1 and should not have blocks from P2.
Expand Down
6 changes: 4 additions & 2 deletions pkg/testsuite/mock/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ func (e *Endpoint) Send(packet proto.Message, to ...peer.ID) {
e.network.dispatchersMutex.RLock()
defer e.network.dispatchersMutex.RUnlock()

if err := dispatcher.handler(e.id, packet); err != nil {
fmt.Println(e.id, "ERROR: ", err)
if dispatcher.handler != nil {
if err := dispatcher.handler(e.id, packet); err != nil {
fmt.Println(e.id, "ERROR: ", err)
}
}
}()
}
Expand Down
22 changes: 7 additions & 15 deletions pkg/testsuite/mock/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,14 @@ func (n *Node) Initialize(failOnBlockFiltered bool, opts ...options.Option[proto
}

func (n *Node) hookEvents() {
n.Protocol.HeaviestAttestedChain.OnUpdate(func(_, heaviestAttestedChain *protocol.Chain) {
n.forkDetectedCount.Add(1)
n.Protocol.HeaviestAttestedChain.OnUpdate(func(prevHeaviestAttestedChain, heaviestAttestedChain *protocol.Chain) {
if prevHeaviestAttestedChain != nil {
n.forkDetectedCount.Add(1)

heaviestAttestedChain.Engine.OnUpdate(func(prevEngine, newEngine *engine.Engine) {
prevEngineName := "<nil>"
if prevEngine != nil {
prevEngineName = prevEngine.Name()
}

newEngineName := "<nil>"
if newEngine != nil {
newEngineName = newEngine.Name()
}

n.Protocol.LogWarn("ENGINE ACTIVATED FOR CHAIN ", "name", heaviestAttestedChain.LogName(), "counter", n.candidateEngineActivatedCount.Add(1), "prevEngine", prevEngineName, "newEngine", newEngineName)
})
heaviestAttestedChain.Engine.OnUpdate(func(prevEngine, newEngine *engine.Engine) {
n.candidateEngineActivatedCount.Add(1)
})
}
})

n.Protocol.MainChain.OnUpdate(func(_, _ *protocol.Chain) {
Expand Down
27 changes: 14 additions & 13 deletions tools/evil-spammer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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-20230929122509-67f34bfed40d
github.com/iotaledger/hive.go/ds v0.0.0-20230928074706-d58e32f86729
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-20230928074706-d58e32f86729
github.com/iotaledger/hive.go/runtime v0.0.0-20230929122509-67f34bfed40d
github.com/iotaledger/hive.go/app v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/crypto v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/ds v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/ierrors v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/lo v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/logger v0.0.0-20231005070803-455595bf0a07
github.com/iotaledger/hive.go/runtime v0.0.0-20231005070803-455595bf0a07
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-20231003181920-a3245ad7a737
Expand All @@ -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-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-20230928074706-d58e32f86729 // 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/hive.go/ads v0.0.0-20231005070803-455595bf0a07 // indirect
github.com/iotaledger/hive.go/constraints v0.0.0-20231005070803-455595bf0a07 // indirect
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231005070803-455595bf0a07 // indirect
github.com/iotaledger/hive.go/kvstore v0.0.0-20231005070803-455595bf0a07 // indirect
github.com/iotaledger/hive.go/log v0.0.0-20231005070803-455595bf0a07 // indirect
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231005070803-455595bf0a07 // indirect
github.com/iotaledger/hive.go/stringify v0.0.0-20231005070803-455595bf0a07 // 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
Expand Down
Loading

0 comments on commit eb6a8a0

Please sign in to comment.