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

Fork aware max values in rpc #6847

Open
wants to merge 7 commits into
base: unstable
Choose a base branch
from

Conversation

pawanjay176
Copy link
Member

@pawanjay176 pawanjay176 commented Jan 23, 2025

Issue Addressed

N/A

Proposed Changes

In #6329 we changed max_blobs_per_block from a preset to a config value.
We weren't using the right value based on fork in that PR. This is a follow up PR to use the fork dependent values.

In the proces, I also updated other places where we weren't using fork dependent values from the ChainSpec.

Note to reviewer: easier to go through by commit

@pawanjay176 pawanjay176 added Networking electra Required for the Electra/Prague fork labels Jan 23, 2025
@pawanjay176 pawanjay176 requested a review from jxs as a code owner January 23, 2025 02:33
@@ -455,7 +459,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
(None, None)
};

// TODO(pawan): this would break if a batch contains multiple epochs
Copy link
Member Author

Choose a reason for hiding this comment

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

Even if a batch contains multiple epochs (which it doesn't), this is a very niche case that would only break during fork boundaries.

@pawanjay176 pawanjay176 added the ready-for-review The code is ready for review label Jan 23, 2025
Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

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

LGTM Pawan, left some suggestions :)

beacon_node/lighthouse_network/src/rpc/codec.rs Outdated Show resolved Hide resolved
beacon_node/lighthouse_network/src/rpc/codec.rs Outdated Show resolved Hide resolved
beacon_node/lighthouse_network/src/rpc/codec.rs Outdated Show resolved Hide resolved
@@ -258,10 +260,11 @@ pub fn spawn<T: BeaconChainTypes>(
network_send: mpsc::UnboundedSender<NetworkMessage<T::EthSpec>>,
beacon_processor: Arc<NetworkBeaconProcessor<T>>,
sync_recv: mpsc::UnboundedReceiver<SyncMessage<T::EthSpec>>,
fork_context: Arc<ForkContext>,
Copy link
Member

Choose a reason for hiding this comment

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

nit: we can just pass the ForkName which is Copy and avoid clonning the Arc when passing it

Copy link
Member Author

Choose a reason for hiding this comment

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

current_fork can change during runtime so we may use the outdated value if we do that . its just an Arc clone so it's okay imo

Copy link
Member

Choose a reason for hiding this comment

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

makes sense, thanks for explaining Pawan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electra Required for the Electra/Prague fork Networking ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants