feat(p2p): add anchor file for discovery state#11
Conversation
onbjerg
left a comment
There was a problem hiding this comment.
Just nits. Re: IP vs ENR for static peers, I don't sway strongly either way but I would prefer that we keep ENR instead of replacing it entirely with IP
Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
* fix error due to lack of read option * fix empty and nonexistent file error
389734e to
d9347a6
Compare
|
need to check out why tests are failing, looks like I need to change the tests to work in the CI environment, then the only thing blocking this is the upstream PR, will continue with other p2p stuff in the meantime |
|
Ah this? sigp/enr#6. I pinged sigp about it. |
|
yeah that, cool! |
|
@Rjected PR is merged^ |
crates/net/p2p/src/anchor.rs
Outdated
| /// The File handle for the anchor | ||
| file: File, |
There was a problem hiding this comment.
should we store the path instead of the file?
There was a problem hiding this comment.
yeah the path should work and is the input for new_from_file anyways
* change new_from_file to explicitly include logic for opening existing files, rather than calling out to from_toml * remove from_toml because new_from_file handles existing files properly with only a path. It is not possible to obtain a Path from a File anyways, its only purpose was to accept a File type
crates/net/p2p/src/anchor.rs
Outdated
| /// The File handle for the anchor | ||
| file: File, | ||
| /// The Path to store the anchor file | ||
| path: &'a Path, |
There was a problem hiding this comment.
I'd recommend allocating a PathBuf here to get rid of the lifetimes.
There was a problem hiding this comment.
makes sense, just changed
Resolution checkpoint Resolution checkpoint paradigmxyz#2 Resolution checkpoint paradigmxyz#3 x Resolution checkpoint paradigmxyz#4 Resolution checkpoint paradigmxyz#5 Resolution checkpoint paradigmxyz#6 Resolution checkpoint paradigmxyz#7 Resolution checkpoint paradigmxyz#8 Resolve checkpoint paradigmxyz#9 (transaction primitive) Resolve checkpoint paradigmxyz#10 (rpc api transactions) Resolve checkpoint paradigmxyz#11 (building w/o feature flag) Start review Compiling with and without `optimism` feature flag Remove `DepositTx` from txpool mock tests, they never go into the txpool fmt code lint fix signature tests Co-authored-by: nicolas <48695862+merklefruit@users.noreply.github.com> Use free CI runners (revert before upstream) Co-authored-by: refcell <abigger87@gmail.com> Signature test fixes Co-authored-by refcell <abigger87@gmail.com> Fix Receipt proptest Co-authored-by BB <brian.t.bland@gmail.com> lint Fix variable-length compact for txtype/transaction Co-authored-by: Brian Bland <brian.t.bland@gmail.com> Fix basefee tests Remove unnecessary rpc deps Co-authored-by: Brian Bland <brian.t.bland@gmail.com> Co-authored-by: refcell <abigger87@gmail.com> Co-authored-by: nicolas <48695862+merklefruit@users.noreply.github.com> Co-authored-by: Roberto <bayardo@alum.mit.edu>
Resolution checkpoint Resolution checkpoint paradigmxyz#2 Resolution checkpoint paradigmxyz#3 x Resolution checkpoint paradigmxyz#4 Resolution checkpoint paradigmxyz#5 Resolution checkpoint paradigmxyz#6 Resolution checkpoint paradigmxyz#7 Resolution checkpoint paradigmxyz#8 Resolve checkpoint paradigmxyz#9 (transaction primitive) Resolve checkpoint paradigmxyz#10 (rpc api transactions) Resolve checkpoint paradigmxyz#11 (building w/o feature flag) Start review Compiling with and without `optimism` feature flag Remove `DepositTx` from txpool mock tests, they never go into the txpool fmt code lint fix signature tests Co-authored-by: nicolas <48695862+merklefruit@users.noreply.github.com> Use free CI runners (revert before upstream) Co-authored-by: refcell <abigger87@gmail.com> Signature test fixes Co-authored-by refcell <abigger87@gmail.com> Fix Receipt proptest Co-authored-by BB <brian.t.bland@gmail.com> lint Fix variable-length compact for txtype/transaction Co-authored-by: Brian Bland <brian.t.bland@gmail.com> Fix basefee tests Remove unnecessary rpc deps Co-authored-by: Brian Bland <brian.t.bland@gmail.com> Co-authored-by: refcell <abigger87@gmail.com> Co-authored-by: nicolas <48695862+merklefruit@users.noreply.github.com> Co-authored-by: Roberto <bayardo@alum.mit.edu>
…z#11) - Implement `block_hash` (refer to `revm::State<DB>::block_hash`) for `PartitionDB` & `SchedulerDB` - Implement generating read write set for each txn after transact
…z#11) - Implement `block_hash` (refer to `revm::State<DB>::block_hash`) for `PartitionDB` & `SchedulerDB` - Implement generating read write set for each txn after transact
* eip7928 patches * fixes * fixes * msrv
…hancements (paradigmxyz#11) Add new Tectonic modules integrating post-quantum cryptographic features: - Extend crate structure with Tectonic-specific components (chainspec, cli, hardforks, EVM). - Implement Tectonic chain specifications (`TECTONIC_DEV`, `TECTONIC_TEST`, `TECTONIC_DEMO`) using tectonic-themed hardforks (Amur, Burma, Cocos, Danakil). - Add chain spec parser for custom genesis configurations. - Improve Falcon-512 signature precompiles in EVM including test vectors and benchmarks.
Adds a struct called
Anchorwhich represents two types of peers that the node might want to persist:Also introduces
PersistentAnchorwhich can load from a TOML file, saving to a file ondropThis will be used in case the node restarts, so discovery can start off with peers that are likely to be active.
todo: