-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fluffy portal testnet support #2383
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5b9667f
Bump portal-mainnet repo.
web3-developer 97bcd34
Update command line arguments and parsing on startup.
web3-developer d8eb3a9
Read in angelfood bootstrap nodes and update Fluffy guide.
web3-developer 89a244b
Configure subnetwork protocol ids.
web3-developer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ import | |
./network/state/[state_network, state_content], | ||
./network/history/[history_network, history_content], | ||
./network/beacon/[beacon_init_loader, beacon_light_client], | ||
./network/wire/[portal_stream, portal_protocol_config], | ||
./network/wire/[portal_stream, portal_protocol_config, portal_protocol], | ||
./eth_data/history_data_ssz_e2s, | ||
./database/content_db, | ||
./version, | ||
|
@@ -101,24 +101,35 @@ proc run(config: PortalConf) {.raises: [CatchableError].} = | |
loadBootstrapFile(string config.bootstrapNodesFile, bootstrapRecords) | ||
bootstrapRecords.add(config.bootstrapNodes) | ||
|
||
var portalNetwork: PortalNetwork | ||
if config.portalNetworkDeprecated.isSome(): | ||
warn "DEPRECATED: The --network flag will be removed in the future, please use the drop in replacement --portal-network flag instead" | ||
portalNetwork = config.portalNetworkDeprecated.get() | ||
else: | ||
portalNetwork = config.portalNetwork | ||
let portalNetwork = | ||
if config.portalNetworkDeprecated.isNone(): | ||
config.network | ||
else: | ||
warn "DEPRECATED: The --portal-network flag will be removed in the future, " & | ||
"please use the drop in replacement --network flag instead" | ||
config.portalNetworkDeprecated.get() | ||
|
||
let portalSubnetworks = | ||
if config.networksDeprecated == {}: | ||
config.portalSubnetworks | ||
else: | ||
warn "DEPRECATED: The --networks flag will be removed in the future, " & | ||
"please use the drop in replacement --portal-subnetworks flag instead" | ||
config.networksDeprecated | ||
|
||
case portalNetwork | ||
of mainnet: | ||
of PortalNetwork.none: | ||
discard # don't connect to any network bootstrap nodes | ||
of PortalNetwork.mainnet: | ||
for enrURI in mainnetBootstrapNodes: | ||
var record: Record | ||
if fromURI(record, enrURI): | ||
bootstrapRecords.add(record) | ||
of testnet: | ||
# TODO: add testnet repo with bootstrap file. | ||
discard | ||
else: | ||
discard | ||
of PortalNetwork.angelfood: | ||
for enrURI in angelfoodBootstrapNodes: | ||
var record: Record | ||
if fromURI(record, enrURI): | ||
bootstrapRecords.add(record) | ||
|
||
let | ||
discoveryConfig = | ||
|
@@ -210,9 +221,10 @@ proc run(config: PortalConf) {.raises: [CatchableError].} = | |
loadAccumulator() | ||
|
||
historyNetwork = | ||
if Network.history in config.networks: | ||
if PortalSubnetwork.history in portalSubnetworks: | ||
Opt.some( | ||
HistoryNetwork.new( | ||
portalNetwork, | ||
d, | ||
db, | ||
streamManager, | ||
|
@@ -225,9 +237,10 @@ proc run(config: PortalConf) {.raises: [CatchableError].} = | |
Opt.none(HistoryNetwork) | ||
|
||
stateNetwork = | ||
if Network.state in config.networks: | ||
if PortalSubnetwork.state in portalSubnetworks: | ||
Opt.some( | ||
StateNetwork.new( | ||
portalNetwork, | ||
d, | ||
db, | ||
streamManager, | ||
|
@@ -243,12 +256,15 @@ proc run(config: PortalConf) {.raises: [CatchableError].} = | |
beaconLightClient = | ||
# TODO: Currently disabled by default as it is not sufficiently polished. | ||
# Eventually this should be always-on functionality. | ||
if Network.beacon in config.networks and config.trustedBlockRoot.isSome(): | ||
if PortalSubnetwork.beacon in portalSubnetworks and | ||
config.trustedBlockRoot.isSome(): | ||
let | ||
# Portal works only over mainnet data currently | ||
# TODO: investigate this load network data function | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for loading beacon network metadata , so this remains the same for angelfood. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok thanks, I'll remove the comment in my next PR. |
||
networkData = loadNetworkData("mainnet") | ||
beaconDb = BeaconDb.new(networkData, config.dataDir / "db" / "beacon_db") | ||
beaconNetwork = BeaconNetwork.new( | ||
portalNetwork, | ||
d, | ||
beaconDb, | ||
streamManager, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved into portal_protocol_config.nim because these types are needed by portal_protocol.nim