-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Improve processRewardsAndPenalties #6229
Comments
idea 1 is not possible for now because LeftNodes are shared across states, can revisit once we're done with n-historical state #5968 work |
epoch transition time is getting worse and may cause missed attestations at slot 0 as it could be up to 6s vs our test node subscribing to all subnets The difference I see is in publish flow where production mainnet node has to serialize/prefix data while test mainnet node does not have to do that, this may cause we should prioritize gossipsub |
in progress PR ChainSafe/js-libp2p-gossipsub#480 |
PR was merged, need to update gossipsub option when new gossipsub is released |
this is what I see on a mainnet node as of Jul 2024 |
Problem description
The
processRewardsAndPenalties
time is inconsistent, on most of test mainnet nodes it's all goodHowever on a lot of other mainnet nodes it's so different
Note that all of these nodes are with v1.13.0 and are all deployed at the same. Having a look at profile it seems the differences come from how much
gc
run mainly due topackedRootsBytesToLeafNodes
functionSolution description
Reuse the wholebalances
nodes branch to avoidgc
, this helps avoid recreating the wholebalances
branch per epoch transitionh${i}
values to existing leaf nodesh0
to null to trigger a rehash later https://github.com/ChainSafe/ssz/blob/93ab30e4fc2928fb808b4c76ee015631b8770126/packages/persistent-merkle-tree/src/node.ts#L74Update: not possible to do this as branch nodes are shared with other states, should not mutate them.
balances
before recreating the branch. We can bypass it by setting eachbalances[i]
toLeafNodes[Math.floor(i/4)]
,h[(i % 4) * 2]
andh[(i % 4) * 2 + 1]
directlyAdditional context
No response
The text was updated successfully, but these errors were encountered: