Correct ENR decoding on extension trait (#6402)

* Correct enr extension encodings

* Clippy my ol friend

* Correct all encoding and comparisons

* Found some more encodings

* Fix remaining tests
This commit is contained in:
Age Manning
2024-09-20 22:14:57 +10:00
committed by GitHub
parent 46e0d66e2d
commit a97d77c147
6 changed files with 58 additions and 23 deletions

View File

@@ -21,3 +21,4 @@ slog-scope = "4.3.0"
hex = { workspace = true }
serde = { workspace = true }
eth2_network_config = { workspace = true }
bytes = { workspace = true }

View File

@@ -1,4 +1,5 @@
use beacon_node::{get_data_dir, set_network_config};
use bytes::Bytes;
use clap::ArgMatches;
use eth2_network_config::Eth2NetworkConfig;
use lighthouse_network::discv5::{self, enr::CombinedKey, Enr};
@@ -152,7 +153,7 @@ impl<E: EthSpec> BootNodeConfig<E> {
// If we know of the ENR field, add it to the initial construction
if let Some(enr_fork_bytes) = enr_fork {
builder.add_value("eth2", &enr_fork_bytes);
builder.add_value::<Bytes>("eth2", &enr_fork_bytes.into());
}
builder
.build(&local_key)