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

feat(beacon): load trusted block root from embedded file #1689

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

ogenev
Copy link
Member

@ogenev ogenev commented Feb 18, 2025

What was wrong?

To facilitate deployments and UX, on the last call we agreed to rely on an embedded trusted block root file as a fallback mechanism (if the user does not provide it via a --trusted-block-root flag and if the beacon network is enabled).

How was it fixed?

  1. Embed a recent trusted block root into a file.
  2. Load the embedded root as a fallback.

The trusted block root is: 0x107ebc42ce260968c32fba62e2fa6c779f188a0a8c22db0d8afc75801c692fc7.

To-Do

@ogenev ogenev force-pushed the embed-trusted-root branch from 4ae8337 to a38a06a Compare February 18, 2025 12:42
@ogenev ogenev marked this pull request as ready for review February 18, 2025 12:54
Copy link
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

I think we should use include_str!("../../resources/genesis/mainnet.json"), RustEmbed seems pretty overkill, for something include_str!() can accomplish easily and is also apart of the Rust Core Library

@ogenev ogenev force-pushed the embed-trusted-root branch from a38a06a to 9cf77e9 Compare February 19, 2025 09:07
@ogenev
Copy link
Member Author

ogenev commented Feb 19, 2025

I think we should use include_str!("../../resources/genesis/mainnet.json"), RustEmbed seems pretty overkill, for something include_str!() can accomplish easily and is also apart of the Rust Core Library

I changed it to include_str!() as it is simpler, and we are not planning to add more files to the folder for now. Ready for re-review.

@ogenev ogenev force-pushed the embed-trusted-root branch from 9cf77e9 to 48f0e98 Compare February 19, 2025 11:36
Copy link
Collaborator

@morph-dev morph-dev left a comment

Choose a reason for hiding this comment

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

🚀

@ogenev ogenev force-pushed the embed-trusted-root branch 2 times, most recently from 857388c to ce12808 Compare February 19, 2025 12:07
Copy link
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

:shipit: much cleaner 🚀

@@ -52,7 +53,7 @@ impl BeaconNetwork {
header_oracle: Arc<RwLock<HeaderOracle>>,
) -> anyhow::Result<Self> {
let config = OverlayConfig {
bootnode_enrs: portal_config.bootnodes,
bootnode_enrs: portal_config.bootnodes.clone(),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
bootnode_enrs: portal_config.bootnodes.clone(),
bootnode_enrs: portal_config.bootnodes,

Does this need a clone?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, because portal_config is used again below.

@ogenev ogenev force-pushed the embed-trusted-root branch from ce12808 to 9ec14dc Compare February 19, 2025 13:48
@ogenev ogenev merged commit ef7bcfe into ethereum:master Feb 19, 2025
14 checks passed
@ogenev ogenev deleted the embed-trusted-root branch February 19, 2025 14:01
oac1771 pushed a commit to oac1771/trin that referenced this pull request Feb 23, 2025
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.

3 participants