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

Complete IBD & Relay Flows #138

Merged
merged 44 commits into from
Mar 14, 2023
Merged

Conversation

michaelsutton
Copy link
Contributor

@michaelsutton michaelsutton commented Mar 6, 2023

This PR implements the complete relay inv (inventory of block hashes) and IBD P2P flows, such that a node can now sync and keep live with current mainnet.

This can be seen by passing a mainnet node ip:port to the --connect cmd flag of the kaspad bin.

Some changes from golang implementation were introduced in order to utilize the more powerful and parallel-ready consensus engine.

consensus/src/consensus/mod.rs Show resolved Hide resolved
kaspad/src/main.rs Show resolved Hide resolved
consensus/src/pipeline/deps_manager.rs Outdated Show resolved Hide resolved
consensus/src/pipeline/deps_manager.rs Outdated Show resolved Hide resolved
consensus/src/pipeline/deps_manager.rs Show resolved Hide resolved
protocol/flows/src/v5/blockrelay/flow.rs Outdated Show resolved Hide resolved
protocol/flows/src/v5/blockrelay/flow.rs Outdated Show resolved Hide resolved
protocol/flows/src/v5/ibd/flow.rs Show resolved Hide resolved
protocol/flows/src/v5/ibd/flow.rs Outdated Show resolved Hide resolved
protocol/flows/src/v5/ibd/flow.rs Outdated Show resolved Hide resolved
consensus/src/consensus/mod.rs Outdated Show resolved Hide resolved
kaspad/src/main.rs Show resolved Hide resolved
@michaelsutton michaelsutton merged commit b2a142b into kaspanet:master Mar 14, 2023
@michaelsutton michaelsutton deleted the flows-ibd-3 branch March 14, 2023 12:47
smartgoo pushed a commit to smartgoo/rusty-kaspa that referenced this pull request Jun 18, 2024
* avoid printing full messages on message mismatch

* initial orphans pool with basic tests passing

# Conflicts:
#	consensus/src/consensus/mod.rs

* queue duplication removal

* blockrelay mod

* initial relay invs flow

* more details of relay invs flow

* fix minor rebase issues

* fix consensus api

* sync missing block bodies

* ibd chain negotiation (to be tested)

* ibd <-> invs channel

* is ibd running

* ibd type decision

* temp patch

* server side never dequeues with timeout

* temp print

* fix filter direction

* low hash should be the highest with body

* bug fix: flip low and high on locator request

* parallel block body processing

* sync block relay past

* optimize unorphaning

* various fixes to antipast iteration

* fix monitor prints

* make monitor an async service and avoid the thread waste

* use try_join_all wherever possible

* progress reports

* fix of subtle bug related to queuing the same block to consensus from multiple locations concurrently (with different order guarantees)

* take the processed task out of pending for more accurate state maintaining

* avoid heap allocation in the common case

* virtual merge depth rule to reject unmergable relays

* can simply use current pruning point (which is what merge depth algo expects + like golang imp)

* move params and config to core + pass to flow ctx

* comments + minor

* relay all new virtual parents

* manage shared block requests

* fix ibd completion message

* ibd type decision making

* imp validate_staging_timestamps

* address review comments

* fix rebase errors

* temp workaround

* temp workaround #2

* review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants