Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Reactive protocol rework #293

Merged
merged 422 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
422 commits
Select commit Hold shift + click to select a range
31873ba
Fix: linter happy now?
hmoog Oct 6, 2023
c671b8d
Fix: meh :/
hmoog Oct 6, 2023
8594ba8
Fix: fixed data race
hmoog Oct 6, 2023
2952932
Fix: fixed bug in test framework
hmoog Oct 6, 2023
7512c22
Feat: moved EngineManager to protocol
hmoog Oct 6, 2023
b9a3034
Refactor: cleaned up more code
hmoog Oct 6, 2023
8ae6de1
Refactor: restructured more code
hmoog Oct 6, 2023
0dc53df
Refactor: started moving protocol methods to protocol
hmoog Oct 6, 2023
173e7b2
Feat: started moving method to protocol
hmoog Oct 6, 2023
7707e8b
Refactor: started introducing cleaner sub-components
hmoog Oct 6, 2023
1deb2d6
Feat: made network_manager no module
hmoog Oct 6, 2023
be117a1
Feat: addressed linter errors
hmoog Oct 7, 2023
a53bf45
Feat: added HookedStopped
hmoog Oct 7, 2023
666dafe
Refactor: removed ambiguitiy
hmoog Oct 7, 2023
5607410
Feat: addressed more linter warnings
hmoog Oct 7, 2023
021eb8f
Refactor: moved more code
hmoog Oct 7, 2023
055add7
Refactor: refactored more code
hmoog Oct 7, 2023
4454d17
Refactor: removed unnecessary log
hmoog Oct 7, 2023
e14db7a
Feat: broke out AttestationsRequester
hmoog Oct 7, 2023
9c77277
Refactor: moar refactor
hmoog Oct 7, 2023
6cd1622
Feat: moved all methods to sub protocols
hmoog Oct 7, 2023
9bdc2e1
Refactor: refactored file structuure
hmoog Oct 8, 2023
7bd12d4
Refactor: addressed linter warning
hmoog Oct 8, 2023
9fc0104
Fix: fixed bug
hmoog Oct 8, 2023
d8a1fd0
Refactor: reduced change surface
hmoog Oct 8, 2023
460829c
Refactor: reverted changes
hmoog Oct 8, 2023
e91ed60
Refactor: reverted changes
hmoog Oct 8, 2023
b5cc8f5
Refactor: reverted more changes
hmoog Oct 8, 2023
b88389e
Feat: added support for ChainSwitchingThreshold
hmoog Oct 8, 2023
3c17e45
Feat: added variables to track down nil pointer exception
hmoog Oct 8, 2023
3121333
Feat: more checks
hmoog Oct 8, 2023
aa25235
Feat: added check to ApiForVersion
hmoog Oct 8, 2023
1b00b72
Refactor: re-enabled disabled test
hmoog Oct 8, 2023
ca06d5f
Feat: cleaned up EngineManager
hmoog Oct 9, 2023
a10b0d4
Feat: improved logging to find reason for failing test
hmoog Oct 9, 2023
d25d4a6
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Oct 9, 2023
7a3a289
Refactor: reverted changes
hmoog Oct 9, 2023
84628ee
Feat: used reactivemodule
hmoog Oct 9, 2023
d39b555
Refactor: removed MainEngineInstance
hmoog Oct 9, 2023
1ed9de3
Feat: added shutdown logic to engine manager
hmoog Oct 10, 2023
34f5e4b
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Oct 11, 2023
fc79876
Feat: WIP WARPSYNC CHANGES
hmoog Oct 17, 2023
fd9bcc8
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Oct 20, 2023
496cc81
Feat: added debug output
hmoog Oct 20, 2023
a7e3642
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Oct 20, 2023
1a994fa
Fix some bugs when integrating cached reset branch (#474)
hmoog Oct 30, 2023
77cb8cc
Refactor: cleaned more code
hmoog Oct 30, 2023
647d023
Feat: started experimenting with definitions framework
hmoog Oct 30, 2023
0b3ba89
Fix: fixed bug with erroneous transition rule
hmoog Oct 31, 2023
a98681a
Feat: refactored code
hmoog Oct 31, 2023
03605c0
Feat: cleaned more code
hmoog Oct 31, 2023
070b946
Refactor: wip wip wip
hmoog Nov 1, 2023
5d59b3f
Refactor: add more outputs to detect failure in CI
hmoog Nov 1, 2023
62a9f14
Feat: more logs
hmoog Nov 1, 2023
aac4389
Feat: add more logging
hmoog Nov 1, 2023
281d2f1
Fix: fixed some logic
hmoog Nov 2, 2023
69b9d88
Refactor: codegasm
hmoog Nov 2, 2023
a0bde5c
Refactor: unembedded Engines
hmoog Nov 2, 2023
0c33362
Refactor: played with hive.go framework structure
hmoog Nov 2, 2023
16ce5ce
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 2, 2023
e9b7a2b
Fix: addressed linter warnings
hmoog Nov 2, 2023
3c2ad4e
Refactor: cleaned up more code
hmoog Nov 2, 2023
69f0b58
Feat: cleaned up chain inheritance
hmoog Nov 3, 2023
0bfc546
Merge remote-tracking branch 'origin/develop' into feat/reactive-chai…
karimodm Nov 3, 2023
e54b283
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 3, 2023
69745c2
Feat: increased waiting time for test to pass
hmoog Nov 3, 2023
63834ce
Fix: fixed chain inheritance
hmoog Nov 3, 2023
5f233f0
Feat: add logs to failing test
hmoog Nov 3, 2023
017da90
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 4, 2023
a7a30a5
Feat: fixed chain inheritance
hmoog Nov 5, 2023
6f8210e
Refactor: removed comments + looping test
hmoog Nov 5, 2023
dd70408
Refactor: adjust comments
hmoog Nov 6, 2023
c98bcda
Refactor: remove go.work
hmoog Nov 6, 2023
38a0ac5
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 7, 2023
5b9763e
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 7, 2023
726331f
Refactor: removed timeout
hmoog Nov 7, 2023
a7c8225
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 7, 2023
9e529a4
Feat: cleaned options
hmoog Nov 7, 2023
df283fb
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 7, 2023
551007a
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 7, 2023
3126a41
Feat: cleaned up code
hmoog Nov 7, 2023
dadeb8c
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 7, 2023
57a9e90
Feat: missing file
hmoog Nov 7, 2023
9b5feac
Fix: fixed merge conflicts
hmoog Nov 7, 2023
8740c32
Feat: reordered logs
hmoog Nov 8, 2023
f072485
Feat: upgraded to hive
hmoog Nov 8, 2023
d79116f
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 8, 2023
60a65e9
Fix: fixed some pending merge errors
hmoog Nov 9, 2023
70582dc
Refactor: fixed refactor bug
hmoog Nov 9, 2023
9e3290e
Refactor: go mod tidy
hmoog Nov 9, 2023
2860af4
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 9, 2023
c5dfffe
Feat: update iota.go
hmoog Nov 9, 2023
5e94d84
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 9, 2023
b2d7862
Refactor: addressed linter remarks
hmoog Nov 9, 2023
10b123a
Refactor: addressed more linter remarks
hmoog Nov 9, 2023
6224ffa
Refactor: addressed more linter warnings
hmoog Nov 9, 2023
337ca36
Refactor: still more
hmoog Nov 9, 2023
522c971
Refactor: and even more
hmoog Nov 9, 2023
672d080
Refactor: fixed bug in chain inheritance after merge
hmoog Nov 9, 2023
9786bc2
Feat: started refactoring chains
hmoog Nov 9, 2023
d09d430
Refactor: renamed chains properties
hmoog Nov 9, 2023
cf7289f
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 9, 2023
7a40424
Refactor: cleaning up chains
hmoog Nov 9, 2023
3bcf9d0
Feat: started using latest hive.go features
hmoog Nov 9, 2023
4353b80
Feat: fixed nil pointer exception
hmoog Nov 9, 2023
6bdbd73
Feat: moved evictionstate to procotol
hmoog Nov 9, 2023
fe7cea0
Refactor: introduced subcomponent tracking commitments
hmoog Nov 9, 2023
38700a3
Refactor: removed CommitmentCreated event
hmoog Nov 9, 2023
39da887
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 9, 2023
577aa2d
Feat: go mod tidy
hmoog Nov 9, 2023
2a81f39
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 10, 2023
c509f88
Feat: introduced blocktowarpsync
hmoog Nov 10, 2023
cb3aff9
Refactor: refactor chains
hmoog Nov 10, 2023
74f70a2
Refactor: started cleaning up chain
hmoog Nov 10, 2023
09eeddb
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 10, 2023
1777616
Feat: merge
hmoog Nov 10, 2023
ae6b0c8
Refactor: more cleanup
hmoog Nov 10, 2023
fda739f
Refactor: refactored some code
hmoog Nov 10, 2023
95eb78c
Merge branch 'feat/cache-reset' of github.com:iotaledger/iota-core in…
hmoog Nov 10, 2023
884d415
Merge remote-tracking branch 'origin/develop' into feat/reactive-chai…
karimodm Nov 15, 2023
a29b142
Fix RootCommitment load below genesis slot
karimodm Nov 15, 2023
837e70f
Merge remote-tracking branch 'origin/develop' into feat/reactive-chai…
karimodm Nov 16, 2023
00bdb31
Docker 5 genesisSlot
karimodm Nov 16, 2023
490361a
Increase log levels
karimodm Nov 16, 2023
84a997f
trace log doesn't exist
karimodm Nov 16, 2023
329990c
trace loglevel does not exist
karimodm Nov 17, 2023
a92a3fa
Feat: added Commitments.Root
hmoog Nov 20, 2023
77098bb
Merge branch 'feat/reactive-chainmanager' of github.com:iotaledger/io…
hmoog Nov 21, 2023
25c2584
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 21, 2023
cecb64b
Fix: fix merge conflicts
hmoog Nov 21, 2023
fc6991e
Feat: add logging
hmoog Nov 21, 2023
f77aa25
Feat: started refactoring / cleaning up code
hmoog Nov 22, 2023
b905bd5
Feat: more cleanup
hmoog Nov 22, 2023
ab607ee
Refactor: moved private method to end
hmoog Nov 22, 2023
a43a72a
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 22, 2023
02b8c1e
Feat: fixed race condition in hive
hmoog Nov 22, 2023
56b35b7
Feat: finished commenting chain
hmoog Nov 22, 2023
21d93d7
Feat: started cleaning up chains.go
hmoog Nov 22, 2023
65dc972
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 22, 2023
9ad22fe
Feat: continued to cleanup
hmoog Nov 23, 2023
6976153
Refactor: removed unused code
hmoog Nov 23, 2023
f141e0e
Refactor: more cleanup
hmoog Nov 23, 2023
367ea73
Refactor: chains almost done
hmoog Nov 23, 2023
415a555
Feat: chain is close to optimal code structure
hmoog Nov 23, 2023
86a829b
Feat: finished cleaning up chain.go and chains.go
hmoog Nov 24, 2023
f6a5978
Refactor: started chaning commitment to new style
hmoog Nov 24, 2023
9b9af77
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 24, 2023
f71fde5
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 24, 2023
ff6cf4b
Feat: started cleaning up commitments
hmoog Nov 25, 2023
ce4e08f
Refactor: refactor commitments prior to commenting
hmoog Nov 26, 2023
91f08e9
Refactor: refactored commitments
hmoog Nov 26, 2023
381fefe
Feat: finished cleaning up commitment.go and commitments.go
hmoog Nov 27, 2023
a108d77
Refactor: extended comments
hmoog Nov 27, 2023
22a5fca
Feat: cleaned up protocol.go, options.go, events.go, errors.go
hmoog Nov 27, 2023
ec1b453
Feat: DONE?
hmoog Nov 27, 2023
0d02a01
Fix: fix naming issues
hmoog Nov 27, 2023
ba0da46
Feat: enable engine logging
hmoog Nov 27, 2023
893deae
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 27, 2023
b6878f4
Fix: Fix WarpSync
hmoog Nov 27, 2023
0539f34
Feat: added more logic
hmoog Nov 27, 2023
e82a4be
Fix: fixed more code
hmoog Nov 27, 2023
ab3fdec
Trigger Commitment's IsCommittable at - MCA + 1
karimodm Nov 27, 2023
66807e0
Deadlock fix
karimodm Nov 27, 2023
d77b7cb
Fix race in notarization vs attestations
karimodm Nov 28, 2023
18ab2ef
Merge branch 'feat/reactive-chainmanager' into fix/warpSync
karimodm Nov 28, 2023
e23b164
Fix: MainEngine no longer registers as candidate
hmoog Nov 28, 2023
000355b
Force accept and commit with MCA delay
karimodm Nov 28, 2023
f7aca11
Refactor: disable engine logging
hmoog Nov 28, 2023
58a9972
Add rootblocks only before force-accepting them
karimodm Nov 28, 2023
d86db88
Merge pull request #573 from iotaledger/fix/reactive-candidates
karimodm Nov 28, 2023
d1cfa46
Merge remote-tracking branch 'origin/feat/reactive-chainmanager' into…
karimodm Nov 28, 2023
9e9697c
Reset the Engine when WarpSyncMode turns true
karimodm Nov 28, 2023
2604e3c
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 28, 2023
4338642
Merge branch 'feat/reactive-chainmanager' of github.com:iotaledger/io…
hmoog Nov 28, 2023
51431c7
Fix: TestLossOfAcceptanceFromGenesis test fixed
hmoog Nov 28, 2023
c5e8d76
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 28, 2023
407c833
Refactor: enable engine logging
hmoog Nov 28, 2023
ef9927b
Merge branch 'feat/reactive-chainmanager' of github.com:iotaledger/io…
hmoog Nov 29, 2023
b4d6346
Feat: increased timeout
hmoog Nov 29, 2023
e1bfcdf
Feat: extend waiting time?
hmoog Nov 29, 2023
1e4b2f2
Feat: Added PR for bundled changes while debugging
hmoog Nov 29, 2023
a467a26
Feat: added more logs
hmoog Nov 29, 2023
ed38887
Feat: added log output
hmoog Nov 29, 2023
0db2bf0
Feat: changed some code
hmoog Nov 30, 2023
13cd73a
Feat: added log
hmoog Nov 30, 2023
8f60e3d
Feat: add logging
hmoog Nov 30, 2023
a524987
Feat: added logging
hmoog Nov 30, 2023
ff87a2e
Feat: added solidity stuff to the logging - let's see
hmoog Nov 30, 2023
8b97187
Feat: add logging
hmoog Nov 30, 2023
146feba
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Nov 30, 2023
7b8abd6
Merge branch 'feat/reactive-chainmanager' of github.com:iotaledger/io…
hmoog Nov 30, 2023
aa6642e
Change warp sync to wait for WeightPropagated instead of Booked of bl…
jonastheis Dec 1, 2023
bb338af
Adjust TestProtocol_EngineSwitching_CommitteeRotation to wait for the…
jonastheis Dec 1, 2023
aeb9258
Fix calculation of WarpSyncThreshold
jonastheis Dec 1, 2023
62a9cb4
WarpSyncMode should be enabled if latestProducedCommitment == nil
jonastheis Dec 1, 2023
7243706
Feat: fixed some stuff
hmoog Dec 1, 2023
66e843a
Merge branch 'fix/warpSync' of github.com:iotaledger/iota-core into d…
hmoog Dec 1, 2023
32ebf8b
Fix: fixed tests
hmoog Dec 1, 2023
b3049b5
Refactor: reverted changes
hmoog Dec 1, 2023
9c845ec
Refactor: reverted more changes
hmoog Dec 1, 2023
1e8e9dd
Refactor: reverted more changes
hmoog Dec 1, 2023
52694be
Fix: fixed bugs and refactored code
hmoog Dec 1, 2023
8ad929b
Refactor: refactored warpsync to be able to handle loss of acceptance
hmoog Dec 3, 2023
89f0213
Refactor: fixed typo + race condition
hmoog Dec 3, 2023
af324c3
Fix bugs in WarpSync logic (#577)
hmoog Dec 3, 2023
6eae1b4
Refactor: started reverting unnecessary changes
hmoog Dec 3, 2023
14f7108
Merge branch 'fix/warpSync' of github.com:iotaledger/iota-core into d…
hmoog Dec 3, 2023
7675908
Refactor: reverted changes
hmoog Dec 3, 2023
8a2a19e
Refactor: reverted rename
hmoog Dec 3, 2023
aa420c9
Refactor: addressed linter issues
hmoog Dec 3, 2023
dd8771a
Refactor: reduced changes
hmoog Dec 3, 2023
044b797
Refactor: reverted unnecessary changes
hmoog Dec 3, 2023
010e103
Refactor: reverted more changes
hmoog Dec 3, 2023
a3a5c72
Refactor: minimizing more changes
hmoog Dec 3, 2023
0ce46e7
Refactor: reverted more code
hmoog Dec 3, 2023
b6b430f
Refactor: revert
hmoog Dec 3, 2023
5beda14
Refactor: revert
hmoog Dec 3, 2023
2b819f9
Refactor: reverted more
hmoog Dec 3, 2023
75240f0
Refactor: revert
hmoog Dec 3, 2023
e83a78e
Fix: fix possible nil pointer exception
hmoog Dec 3, 2023
90c1fd3
Refactor: renamed flags
hmoog Dec 4, 2023
8b5b5dc
Refactor: finished rename
hmoog Dec 4, 2023
5241622
Refactor: refactored warpsync protocol
hmoog Dec 4, 2023
c6a7242
Feat: updated comments
hmoog Dec 4, 2023
5fb3535
Refactor: updated comments
hmoog Dec 4, 2023
d8f5208
Merge remote-tracking branch 'origin/develop' into feat/reactive-chai…
jonastheis Dec 4, 2023
bfe40ba
Merge remote-tracking branch 'origin/feat/reactive-chainmanager' into…
jonastheis Dec 4, 2023
2cac971
Merge remote-tracking branch 'origin/develop' into feat/reactive-chai…
karimodm Dec 4, 2023
6044a6d
Merge branch 'feat/reactive-chainmanager' into fix/warpSync
karimodm Dec 4, 2023
9576fd6
Do not mark blocks as root blocks when warp syncing as that is done a…
jonastheis Dec 4, 2023
d8d6430
Address review comments
jonastheis Dec 4, 2023
1419993
Merge branch 'fix/warpSync' of github.com:iotaledger/iota-core into f…
jonastheis Dec 4, 2023
610eb3d
Delete evil spammer as they are moved to evil tools repo
jonastheis Dec 4, 2023
ac6a993
Fix deadlock
jonastheis Dec 4, 2023
edf541f
Merge pull request #568 from iotaledger/fix/warpSync
karimodm Dec 4, 2023
a97b114
Update pkg/protocol/chains.go
hmoog Dec 4, 2023
9c9d51e
Update pkg/protocol/chains.go
hmoog Dec 4, 2023
cc008bc
Update pkg/protocol/chains.go
hmoog Dec 4, 2023
5131ad4
Feat: addresse some remarks
hmoog Dec 4, 2023
c6e0c54
Merge branch 'feat/reactive-chainmanager' of github.com:iotaledger/io…
hmoog Dec 4, 2023
20574a5
Refactor: removed EarliestRootCommitment
hmoog Dec 5, 2023
3b422af
Feat: addressed more remarks
hmoog Dec 5, 2023
fe3a9d5
Feat: added chain switching condition to engine spawning
hmoog Dec 5, 2023
a5a57ba
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/r…
hmoog Dec 5, 2023
f3d8ad0
Add options for attestation and warp sync requester
jonastheis Dec 5, 2023
1609a37
Merge remote-tracking branch 'origin/develop' into feat/reactive-chai…
jonastheis Dec 5, 2023
48b1db2
Remove log and potentially fix race condition for nil block #556
jonastheis Dec 5, 2023
5baf82d
Add comment to commitment_verifier
jonastheis Dec 5, 2023
8b9d1f8
Add version check for received commitments
jonastheis Dec 5, 2023
8829fea
Add shutdown to storage tests
jonastheis Dec 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/dashboard/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ func currentNodeStatus() *nodestatus {
LastPauseGC: m.PauseNs[(m.NumGC+255)%256],
}
// get TangleTime
cl := deps.Protocol.MainEngineInstance().Clock
syncStatus := deps.Protocol.MainEngineInstance().SyncManager.SyncStatus()
cl := deps.Protocol.Engines.Main.Get().Clock
syncStatus := deps.Protocol.Engines.Main.Get().SyncManager.SyncStatus()

status.TangleTime = tangleTime{
Synced: syncStatus.NodeSynced,
Expand Down
20 changes: 10 additions & 10 deletions components/dashboard/explorer_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ func setupExplorerRoutes(routeGroup *echo.Group) {
}

func findBlock(blockID iotago.BlockID) (explorerBlk *ExplorerBlock, err error) {
block, exists := deps.Protocol.MainEngineInstance().Block(blockID)
block, exists := deps.Protocol.Engines.Main.Get().Block(blockID)
if !exists {
return nil, ierrors.Errorf("block not found: %s", blockID.ToHex())
}

cachedBlock, _ := deps.Protocol.MainEngineInstance().BlockCache.Block(blockID)
cachedBlock, _ := deps.Protocol.Engines.Main.Get().BlockCache.Block(blockID)

blockMetadata, err := deps.Protocol.MainEngineInstance().Retainer.BlockMetadata(blockID)
blockMetadata, err := deps.Protocol.Engines.Main.Get().Retainer.BlockMetadata(blockID)
if err != nil {
return nil, ierrors.Wrapf(err, "block metadata %s", blockID.ToHex())
}
Expand Down Expand Up @@ -196,12 +196,12 @@ func getTransaction(c echo.Context) error {
outputID := iotago.OutputID{}
copy(outputID[:], txID[:])

output, err := deps.Protocol.MainEngineInstance().Ledger.Output(outputID)
output, err := deps.Protocol.Engines.Main.Get().Ledger.Output(outputID)
if err != nil {
return err
}

block, exists := deps.Protocol.MainEngineInstance().Block(output.BlockID())
block, exists := deps.Protocol.Engines.Main.Get().Block(output.BlockID())
if !exists {
return ierrors.Errorf("block not found: %s", output.BlockID().ToHex())
}
Expand All @@ -223,12 +223,12 @@ func getTransactionMetadata(c echo.Context) error {
// Get the first output of that transaction (using index 0)
outputID := iotago.OutputID{}
copy(outputID[:], txID[:])
txMetadata, exists := deps.Protocol.MainEngineInstance().Ledger.MemPool().TransactionMetadata(txID)
txMetadata, exists := deps.Protocol.Engines.Main.Get().Ledger.MemPool().TransactionMetadata(txID)
if !exists {
return ierrors.Errorf("tx metadata not found: %s", txID.ToHex())
}

conflicts, _ := deps.Protocol.MainEngineInstance().Ledger.SpendDAG().ConflictingSpenders(txID)
conflicts, _ := deps.Protocol.Engines.Main.Get().Ledger.SpendDAG().ConflictingSpenders(txID)

return httpserver.JSONResponse(c, http.StatusOK, NewTransactionMetadata(txMetadata, conflicts))
}
Expand All @@ -239,7 +239,7 @@ func getOutput(c echo.Context) error {
return err
}

output, err := deps.Protocol.MainEngineInstance().Ledger.Output(outputID)
output, err := deps.Protocol.Engines.Main.Get().Ledger.Output(outputID)
if err != nil {
return err
}
Expand All @@ -253,7 +253,7 @@ func getSlotDetailsByID(c echo.Context) error {
return err
}

commitment, err := deps.Protocol.MainEngineInstance().Storage.Commitments().Load(commitmentID.Slot())
commitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(commitmentID.Slot())
if err != nil {
return err
}
Expand All @@ -262,7 +262,7 @@ func getSlotDetailsByID(c echo.Context) error {
return ierrors.Errorf("commitment in the store for slot %d does not match the given commitmentID (%s != %s)", commitmentID.Slot(), commitment.ID(), commitmentID)
}

diffs, err := deps.Protocol.MainEngineInstance().Ledger.SlotDiffs(commitmentID.Slot())
diffs, err := deps.Protocol.Engines.Main.Get().Ledger.SlotDiffs(commitmentID.Slot())
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/tip.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func setupTipsRoutes(routeGroup *echo.Group) {
}

func tips() *TipsResponse {
allTips := append(deps.Protocol.MainEngineInstance().TipManager.StrongTips(), deps.Protocol.MainEngineInstance().TipManager.WeakTips()...)
allTips := append(deps.Protocol.Engines.Main.Get().TipManager.StrongTips(), deps.Protocol.Engines.Main.Get().TipManager.WeakTips()...)
t := make([]string, len(allTips))

for i, tip := range allTips {
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/visualizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func sendVertex(blk *blocks.Block, confirmed bool) {
IsTx: isTx,
IsTxAccepted: func() bool {
if isTx {
txMetadata, exists := deps.Protocol.MainEngineInstance().Ledger.MemPool().TransactionMetadata(lo.PanicOnErr(signedTransaction.Transaction.ID()))
txMetadata, exists := deps.Protocol.Engines.Main.Get().Ledger.MemPool().TransactionMetadata(lo.PanicOnErr(signedTransaction.Transaction.ID()))
if exists {
return txMetadata.IsAccepted()
}
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func runWebSocketStreams(component *app.Component) {
broadcastWsBlock(&wsblk{MsgTypeNodeStatus, currentNodeStatus()})
broadcastWsBlock(&wsblk{MsgTypeNeighborMetric, neighborMetrics()})
broadcastWsBlock(&wsblk{MsgTypeTipsMetric, &tipsInfo{
TotalTips: len(deps.Protocol.MainEngineInstance().TipManager.StrongTips()) + len(deps.Protocol.MainEngineInstance().TipManager.WeakTips()),
TotalTips: len(deps.Protocol.Engines.Main.Get().TipManager.StrongTips()) + len(deps.Protocol.Engines.Main.Get().TipManager.WeakTips()),
}})
case *componentsmetric:
broadcastWsBlock(&wsblk{MsgTypeComponentCounterMetric, x})
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard_metrics/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func run() error {
}

func configureComponentCountersEvents() {
deps.Protocol.Events.Network.BlockReceived.Hook(func(_ *model.Block, _ peer.ID) {
deps.Protocol.Network.OnBlockReceived(func(_ *model.Block, _ peer.ID) {
incComponentCounter(Received)
})

Expand Down
6 changes: 3 additions & 3 deletions components/dashboard_metrics/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func nodeInfoExtended() *NodeInfoExtended {

func databaseSizesMetrics() (*DatabaseSizesMetric, error) {
return &DatabaseSizesMetric{
Prunable: deps.Protocol.MainEngineInstance().Storage.PrunableDatabaseSize(),
Permanent: deps.Protocol.MainEngineInstance().Storage.PermanentDatabaseSize(),
Total: deps.Protocol.MainEngineInstance().Storage.Size(),
Prunable: deps.Protocol.Engines.Main.Get().Storage.PrunableDatabaseSize(),
Permanent: deps.Protocol.Engines.Main.Get().Storage.PermanentDatabaseSize(),
Total: deps.Protocol.Engines.Main.Get().Storage.Size(),
Time: time.Now().Unix(),
}, nil
}
2 changes: 1 addition & 1 deletion components/debugapi/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func getSlotBlockIDs(index iotago.SlotIndex) (*BlockChangesResponse, error) {
blocksForSlot, err := deps.Protocol.MainEngineInstance().Storage.Blocks(index)
blocksForSlot, err := deps.Protocol.Engines.Main.Get().Storage.Blocks(index)
if err != nil {
return nil, ierrors.Wrapf(err, "failed to get block storage bucket for slot %d", index)
}
Expand Down
23 changes: 13 additions & 10 deletions components/debugapi/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (

"github.com/iotaledger/hive.go/ds/walker"
"github.com/iotaledger/hive.go/ierrors"
"github.com/iotaledger/iota-core/pkg/protocol/chainmanager"
"github.com/iotaledger/iota-core/pkg/protocol"
)

func chainManagerAllChainsDot() (string, error) {
rootCommitment := deps.Protocol.ChainManager.RootCommitment()
rootCommitment := deps.Protocol.Chains.Main.Get().ForkingPoint.Get()
g := graphviz.New()
defer g.Close()

Expand All @@ -32,7 +32,7 @@ func chainManagerAllChainsDot() (string, error) {
}

func chainManagerAllChainsRendered() ([]byte, error) {
rootCommitment := deps.Protocol.ChainManager.RootCommitment()
rootCommitment := deps.Protocol.Chains.Main.Get().ForkingPoint.Get()
g := graphviz.New()
defer g.Close()

Expand All @@ -50,7 +50,7 @@ func chainManagerAllChainsRendered() ([]byte, error) {
return buf.Bytes(), nil
}

func prepareCommitmentGraph(g *graphviz.Graphviz, rootCommitment *chainmanager.ChainCommitment) (*cgraph.Graph, error) {
func prepareCommitmentGraph(g *graphviz.Graphviz, rootCommitment *protocol.Commitment) (*cgraph.Graph, error) {
graph, err := g.Graph()
if err != nil {
return nil, err
Expand All @@ -62,36 +62,39 @@ func prepareCommitmentGraph(g *graphviz.Graphviz, rootCommitment *chainmanager.C
}
root.SetColor("green")

for commitmentWalker := walker.New[*chainmanager.ChainCommitment](false).Push(rootCommitment); commitmentWalker.HasNext(); {
for commitmentWalker := walker.New[*protocol.Commitment](false).Push(rootCommitment); commitmentWalker.HasNext(); {
parentCommitment := commitmentWalker.Next()
parent, parentErr := createNode(graph, parentCommitment)
if parentErr != nil {
return nil, parentErr
}

for _, childCommitment := range parentCommitment.Children() {
if err = parentCommitment.Children.ForEach(func(childCommitment *protocol.Commitment) error {
child, childErr := createNode(graph, childCommitment)
if childErr != nil {
return nil, childErr
return childErr
}

if childCommitment.Chain().ForkingPoint.ID() == deps.Protocol.MainEngineInstance().ChainID() {
if childCommitment.Chain.Get() == deps.Protocol.Chains.Main.Get() {
child.SetColor("green")
}

if _, edgeErr := graph.CreateEdge(fmt.Sprintf("%s -> %s", parentCommitment.ID().String()[:8], childCommitment.ID().String()[:8]), parent, child); edgeErr != nil {
return nil, ierrors.Wrapf(edgeErr, "could not create edge %s -> %s", parentCommitment.ID().String()[:8], childCommitment.ID().String()[:8])
return ierrors.Wrapf(edgeErr, "could not create edge %s -> %s", parentCommitment.ID().String()[:8], childCommitment.ID().String()[:8])
}

commitmentWalker.Push(childCommitment)

return nil
}); err != nil {
return nil, err
}
}

return graph, nil
}

func createNode(graph *cgraph.Graph, commitment *chainmanager.ChainCommitment) (*cgraph.Node, error) {
func createNode(graph *cgraph.Graph, commitment *protocol.Commitment) (*cgraph.Node, error) {
node, err := graph.Node(fmt.Sprintf("%d: %s", commitment.ID().Slot(), commitment.ID().String()[:8]))
if err != nil {
return nil, ierrors.Wrapf(err, "could not create node %s", commitment.ID().String()[:8])
Expand Down
2 changes: 1 addition & 1 deletion components/debugapi/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func configure() error {
return err
}

if block, exists := deps.Protocol.MainEngineInstance().BlockCache.Block(blockID); exists && block.ProtocolBlock() != nil {
if block, exists := deps.Protocol.Engines.Main.Get().BlockCache.Block(blockID); exists && block.ProtocolBlock() != nil {
response := BlockMetadataResponseFromBlock(block)

return httpserver.JSONResponse(c, http.StatusOK, response)
Expand Down
4 changes: 2 additions & 2 deletions components/debugapi/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

//nolint:unparam // we have no error case right now
func validatorsSummary() (*ValidatorsSummaryResponse, error) {
seatManager := deps.Protocol.MainEngineInstance().SybilProtection.SeatManager()
latestSlotIndex := deps.Protocol.MainEngineInstance().Storage.Settings().LatestCommitment().Slot()
seatManager := deps.Protocol.Engines.Main.Get().SybilProtection.SeatManager()
latestSlotIndex := deps.Protocol.Engines.Main.Get().Storage.Settings().LatestCommitment().Slot()
latestCommittee, exists := seatManager.CommitteeInSlot(latestSlotIndex)
if !exists {
return nil, ierrors.Errorf("committee for slot %d was not selected", latestSlotIndex)
Expand Down
2 changes: 1 addition & 1 deletion components/debugapi/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func init() {

func storeTransactionsPerSlot(scd *notarization.SlotCommittedDetails) error {
slot := scd.Commitment.Slot()
stateDiff, err := deps.Protocol.MainEngineInstance().Ledger.MemPool().StateDiff(slot)
stateDiff, err := deps.Protocol.Engines.Main.Get().Ledger.MemPool().StateDiff(slot)
if err != nil {
return ierrors.Wrapf(err, "failed to retrieve state diff for slot %d", slot)
}
Expand Down
6 changes: 3 additions & 3 deletions components/inx/server_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (s *Server) ReadIsValidatorAccount(_ context.Context, accountInfoRequest *i
return nil, ierrors.Wrap(err, "error when parsing account id")
}

account, exists, err := deps.Protocol.MainEngineInstance().Ledger.Account(accountID, slot)
account, exists, err := deps.Protocol.Engines.Main.Get().Ledger.Account(accountID, slot)
if err != nil {
return nil, ierrors.Wrapf(err, "error when retrieving account data for %s", accountID)
}
Expand All @@ -29,7 +29,7 @@ func (s *Server) ReadIsCommitteeMember(_ context.Context, accountInfoRequest *in
if err != nil {
return nil, ierrors.Wrap(err, "error when parsing account id")
}
committee, exists := deps.Protocol.MainEngineInstance().SybilProtection.SeatManager().CommitteeInSlot(slot)
committee, exists := deps.Protocol.Engines.Main.Get().SybilProtection.SeatManager().CommitteeInSlot(slot)
if !exists {
return nil, ierrors.Errorf("committee does not exist for slot %d", slot)
}
Expand All @@ -44,7 +44,7 @@ func (s *Server) ReadIsCandidate(_ context.Context, accountInfoRequest *inx.Acco
return nil, ierrors.Wrap(err, "error when parsing account id")
}

isCandidateActive, err := deps.Protocol.MainEngineInstance().SybilProtection.IsCandidateActive(accountID, deps.Protocol.APIForSlot(slot).TimeProvider().EpochFromSlot(slot))
isCandidateActive, err := deps.Protocol.Engines.Main.Get().SybilProtection.IsCandidateActive(accountID, deps.Protocol.APIForSlot(slot).TimeProvider().EpochFromSlot(slot))
if err != nil {
return nil, ierrors.Wrap(err, "error when checking if candidate is active")
}
Expand Down
8 changes: 4 additions & 4 deletions components/inx/server_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import (
)

func (s *Server) ReadActiveRootBlocks(_ context.Context, _ *inx.NoParams) (*inx.RootBlocksResponse, error) {
activeRootBlocks := deps.Protocol.MainEngineInstance().EvictionState.ActiveRootBlocks()
activeRootBlocks := deps.Protocol.Engines.Main.Get().EvictionState.ActiveRootBlocks()

return inx.WrapRootBlocks(activeRootBlocks), nil
}

func (s *Server) ReadBlock(_ context.Context, blockID *inx.BlockId) (*inx.RawBlock, error) {
blkID := blockID.Unwrap()
block, exists := deps.Protocol.MainEngineInstance().Block(blkID) // block +1
block, exists := deps.Protocol.Engines.Main.Get().Block(blkID) // block +1
if !exists {
return nil, status.Errorf(codes.NotFound, "block %s not found", blkID.ToHex())
}
Expand Down Expand Up @@ -146,7 +146,7 @@ func (s *Server) ListenToConfirmedBlocks(_ *inx.NoParams, srv inx.INX_ListenToCo
}

func (s *Server) ReadAcceptedBlocks(slot *inx.SlotIndex, srv inx.INX_ReadAcceptedBlocksServer) error {
blocksStore, err := deps.Protocol.MainEngineInstance().Storage.Blocks(slot.Unwrap())
blocksStore, err := deps.Protocol.Engines.Main.Get().Storage.Blocks(slot.Unwrap())
if err != nil {
return status.Errorf(codes.InvalidArgument, "failed to get blocks: %s", err.Error())
}
Expand Down Expand Up @@ -203,7 +203,7 @@ func (s *Server) attachBlock(ctx context.Context, block *iotago.Block) (*inx.Blo
}

func getINXBlockMetadata(blockID iotago.BlockID) (*inx.BlockMetadata, error) {
retainerBlockMetadata, err := deps.Protocol.MainEngineInstance().Retainer.BlockMetadata(blockID)
retainerBlockMetadata, err := deps.Protocol.Engines.Main.Get().Retainer.BlockMetadata(blockID)
if err != nil {
return nil, ierrors.Errorf("failed to get BlockMetadata: %v", err)
}
Expand Down
10 changes: 5 additions & 5 deletions components/inx/server_commitments.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func inxCommitment(commitment *model.Commitment) *inx.Commitment {

func (s *Server) ListenToCommitments(req *inx.SlotRangeRequest, srv inx.INX_ListenToCommitmentsServer) error {
createCommitmentPayloadForSlotAndSend := func(slot iotago.SlotIndex) error {
commitment, err := deps.Protocol.MainEngineInstance().Storage.Commitments().Load(slot)
commitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(slot)
if err != nil {
if ierrors.Is(err, kvstore.ErrKeyNotFound) {
return status.Errorf(codes.NotFound, "commitment slot %d not found", slot)
Expand Down Expand Up @@ -64,15 +64,15 @@ func (s *Server) ListenToCommitments(req *inx.SlotRangeRequest, srv inx.INX_List
return 0, nil
}

latestCommitment := deps.Protocol.MainEngineInstance().SyncManager.LatestCommitment()
latestCommitment := deps.Protocol.Engines.Main.Get().SyncManager.LatestCommitment()

if startSlot > latestCommitment.Slot() {
// no need to send previous commitments
return 0, nil
}

// Stream all available commitments first
prunedEpoch, hasPruned := deps.Protocol.MainEngineInstance().SyncManager.LastPrunedEpoch()
prunedEpoch, hasPruned := deps.Protocol.Engines.Main.Get().SyncManager.LastPrunedEpoch()
if hasPruned && startSlot <= deps.Protocol.CommittedAPI().TimeProvider().EpochEnd(prunedEpoch) {
return 0, status.Errorf(codes.InvalidArgument, "given startSlot %d is older than the current pruningSlot %d", startSlot, deps.Protocol.CommittedAPI().TimeProvider().EpochEnd(prunedEpoch))
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func (s *Server) ListenToCommitments(req *inx.SlotRangeRequest, srv inx.INX_List
}

func (s *Server) ForceCommitUntil(_ context.Context, slot *inx.SlotIndex) (*inx.NoParams, error) {
err := deps.Protocol.MainEngineInstance().Notarization.ForceCommitUntil(slot.Unwrap())
err := deps.Protocol.Engines.Main.Get().Notarization.ForceCommitUntil(slot.Unwrap())
if err != nil {
return nil, ierrors.Wrapf(err, "error while performing force commit until %d", slot.Index)
}
Expand All @@ -171,7 +171,7 @@ func (s *Server) ReadCommitment(_ context.Context, req *inx.CommitmentRequest) (
commitmentSlot = req.GetCommitmentId().Unwrap().Slot()
}

commitment, err := deps.Protocol.MainEngineInstance().Storage.Commitments().Load(commitmentSlot)
commitment, err := deps.Protocol.Engines.Main.Get().Storage.Commitments().Load(commitmentSlot)
if err != nil {
if ierrors.Is(err, kvstore.ErrKeyNotFound) {
return nil, status.Errorf(codes.NotFound, "commitment slot %d not found", req.GetCommitmentSlot())
Expand Down
4 changes: 2 additions & 2 deletions components/inx/server_issuance.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func (s *Server) RequestTips(_ context.Context, req *inx.TipsRequest) (*inx.TipsResponse, error) {
references := deps.Protocol.MainEngineInstance().TipSelection.SelectTips(int(req.GetCount()))
references := deps.Protocol.Engines.Main.Get().TipSelection.SelectTips(int(req.GetCount()))

return &inx.TipsResponse{
StrongTips: inx.NewBlockIds(references[iotago.StrongParentType]),
Expand All @@ -30,7 +30,7 @@ func (s *Server) ValidatePayload(_ context.Context, payload *inx.RawPayload) (*i

switch typedPayload := blockPayload.(type) {
case *iotago.SignedTransaction:
memPool := deps.Protocol.MainEngineInstance().Ledger.MemPool()
memPool := deps.Protocol.Engines.Main.Get().Ledger.MemPool()

inputReferences, inputsErr := memPool.VM().Inputs(typedPayload.Transaction)
if inputsErr != nil {
Expand Down
Loading
Loading