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

p2p: Capabilities Advertisement for Archival/Catchpoints #5702

Merged
merged 41 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ce487ee
Initial commit of adding kad-dht/discovery
Eric-Warehime Aug 22, 2023
eac5f77
Add licenses
Eric-Warehime Aug 23, 2023
1f91286
Fix circular import in tests
Eric-Warehime Aug 23, 2023
eacd32b
Update bootstrap
Eric-Warehime Aug 28, 2023
b879a9d
partition test
Eric-Warehime Aug 28, 2023
26376d1
Add capabilities advertisement
Eric-Warehime Aug 28, 2023
998ad9e
Run initial advertisement immediately
Eric-Warehime Aug 28, 2023
4cb649c
Integrate capabilities retrieval
Eric-Warehime Aug 28, 2023
fb0b53d
Fix lint
Eric-Warehime Aug 28, 2023
dd79fb4
Refactor catchpoint storing capability
Eric-Warehime Aug 30, 2023
0f75566
Remove circular import
Eric-Warehime Aug 31, 2023
d8dfb52
Add test
Eric-Warehime Aug 31, 2023
0780dd5
Merge remote-tracking branch 'upstream/master' into introduce-dht
Eric-Warehime Aug 31, 2023
4071d55
Make tidy
Eric-Warehime Aug 31, 2023
a440359
Make generate
Eric-Warehime Aug 31, 2023
b0ac19b
Merge remote-tracking branch 'upstream/master' into introduce-dht
Eric-Warehime Aug 31, 2023
0e67a0b
p2p: peerstore backed phonebook (#5710)
shiqizng Aug 31, 2023
55f6430
docker: fix typo in README.md (#5707)
eltociear Aug 31, 2023
ade30a8
scripts(configure_dev): conditional tap homebrew (#5573)
emg110 Aug 31, 2023
3c77a7f
p2p: Return non-loopback multiaddr from Address() if available (#5716)
iansuvak Sep 1, 2023
b212f94
Feature: Disable EnableBlockServiceFallbackToArchiver by default. (#5…
gmalouf Sep 1, 2023
ba92ba3
merklearray: simplify single-leaf proofs (#5703)
zeldovich Sep 1, 2023
caf472a
p2p: Make p2p listen address configurable via config.NetAddress (#5721)
iansuvak Sep 1, 2023
4780a87
chore: fix misspelled filename (#5717)
bbroder-algo Sep 1, 2023
c4dfc1b
goal: Add export and import options for genesis files during network …
algochoi Sep 1, 2023
02b99bb
Simulate: Return application initial states accessed during simulatio…
ahangsu Sep 1, 2023
91c5b1c
Convert to addressTTL
Eric-Warehime Sep 1, 2023
c1bc2b6
Refactor catchpoint tracking logic into config
Eric-Warehime Sep 1, 2023
3e26bab
Add TracksCatchpoints
Eric-Warehime Sep 1, 2023
9bccbf2
Add partitiontest
Eric-Warehime Sep 5, 2023
0c6fd25
Add force catchpoint tracking comment to localTemplate
Eric-Warehime Sep 5, 2023
031f10f
Rename default values CatchpointTracking
Eric-Warehime Sep 5, 2023
9bc7474
Merge branch 'refactor-catchpoint-storing-config' into introduce-dht
Eric-Warehime Sep 5, 2023
3ddf71a
Fix listenAddr refactoring
Eric-Warehime Sep 5, 2023
11d0e67
Don't close ledger in node.Stop
Eric-Warehime Sep 5, 2023
eba2f75
Remove unused test
Eric-Warehime Sep 5, 2023
e5a8aec
Add tests, filter out self in capability peers
Eric-Warehime Sep 5, 2023
89ef9ab
Move forceCatchpointFileGenerationTrackingMode to internal logic
Eric-Warehime Sep 5, 2023
fa24be2
Merge branch 'refactor-catchpoint-storing-config' into introduce-dht
Eric-Warehime Sep 5, 2023
9481a1f
Add invalid addr dht bootstrap test
Eric-Warehime Sep 5, 2023
ee634b4
Avoid name conflict
Eric-Warehime Sep 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: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ const MaxGenesisIDLen = 128
// MaxEvalDeltaTotalLogSize is the maximum size of the sum of all log sizes in a single eval delta.
const MaxEvalDeltaTotalLogSize = 1024

// ForceCatchpointFileGenerationTrackingMode defines the CatchpointTracking mode that would be used to
// force a node to generate catchpoint files.
const ForceCatchpointFileGenerationTrackingMode = 99
Eric-Warehime marked this conversation as resolved.
Show resolved Hide resolved

// LoadConfigFromDisk returns a Local config structure based on merging the defaults
// with settings loaded from the config file from the custom dir. If the custom file
// cannot be loaded, the default config is returned (with the error from loading the
Expand Down
30 changes: 30 additions & 0 deletions config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ type Local struct {

// DisableAPIAuth turns off authentication for public (non-admin) API endpoints.
DisableAPIAuth bool `version[30]:"false"`

// EnableDHT will turn on the hash table for use with capabilities advertisement
EnableDHTProviders bool `version[30]:"false"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v31

}

// DNSBootstrapArray returns an array of one or more DNS Bootstrap identifiers
Expand Down Expand Up @@ -862,3 +865,30 @@ func (cfg *Local) AdjustConnectionLimits(requiredFDs, maxFDs uint64) bool {

return true
}

// StoresCatchpoints returns true if the node is configured to store catchpoints
func (cfg *Local) StoresCatchpoints() bool {
switch cfg.CatchpointTracking {
case -1:
// No catchpoints.
default:
fallthrough
case 0:
if cfg.Archival && (cfg.CatchpointInterval > 0) {
return true
}
case 1:
if cfg.CatchpointInterval > 0 && cfg.Archival {
return true
}
case 2:
if cfg.CatchpointInterval > 0 {
return true
}
Eric-Warehime marked this conversation as resolved.
Show resolved Hide resolved
case ForceCatchpointFileGenerationTrackingMode:
if cfg.CatchpointInterval > 0 {
return true
}
Eric-Warehime marked this conversation as resolved.
Show resolved Hide resolved
}
return false
}
1 change: 1 addition & 0 deletions config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var defaultLocal = Local{
EnableBlockService: false,
EnableBlockServiceFallbackToArchiver: true,
EnableCatchupFromArchiveServers: false,
EnableDHTProviders: false,
EnableDeveloperAPI: false,
EnableExperimentalAPI: false,
EnableFollowMode: false,
Expand Down
25 changes: 23 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/go-querystring v1.0.0
github.com/gorilla/mux v1.8.0
github.com/ipfs/go-log v1.0.5
github.com/jmoiron/sqlx v1.2.0
github.com/karalabe/usb v0.0.2
github.com/labstack/echo/v4 v4.9.1
github.com/libp2p/go-libp2p v0.29.1
github.com/libp2p/go-libp2p-kad-dht v0.24.3
github.com/libp2p/go-libp2p-pubsub v0.9.3
github.com/libp2p/go-yamux/v4 v4.0.1
github.com/mattn/go-sqlite3 v1.14.16
Expand Down Expand Up @@ -70,6 +72,8 @@ require (
github.com/flynn/noise v1.0.0 // indirect
github.com/fortytw2/leaktest v1.3.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.19.5 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
Expand All @@ -82,14 +86,21 @@ require (
github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.2 // indirect
github.com/huin/goupnp v1.2.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/ipfs/boxo v0.10.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/ipld/go-ipld-prime v0.20.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/jmespath/go-jmespath v0.3.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
Expand All @@ -102,6 +113,8 @@ require (
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.3.0 // indirect
github.com/libp2p/go-libp2p-kbucket v0.6.3 // indirect
github.com/libp2p/go-libp2p-record v0.2.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-nat v0.2.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
Expand All @@ -127,14 +140,16 @@ require (
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/onsi/ginkgo/v2 v2.11.0 // indirect
github.com/opencontainers/runtime-spec v1.0.2 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polydawn/refmt v0.89.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-19 v0.3.3 // indirect
github.com/quic-go/qtls-go1-20 v0.2.3 // indirect
Expand All @@ -148,6 +163,11 @@ require (
github.com/stretchr/objx v0.5.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/dig v1.17.0 // indirect
go.uber.org/fx v1.20.0 // indirect
Expand All @@ -159,6 +179,7 @@ require (
golang.org/x/term v0.10.0 // indirect
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
golang.org/x/tools v0.11.0 // indirect
gonum.org/v1/gonum v0.13.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading