-
Notifications
You must be signed in to change notification settings - Fork 784
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
Changes for devnet-8
#4518
Changes for devnet-8
#4518
Conversation
ExecutionPayload::Capella(payload) => Ok(Self::Capella(NewPayloadRequestCapella { | ||
execution_payload: payload, | ||
})), | ||
ExecutionPayload::Deneb(_) => Err(Self::Error::IncorrectStateVariant), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this returns an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For deneb
, you can't convert only an ExecutionPayload
into a NewPayloadRequest
, you also need the parent_beacon_block_root
. This conversion is only used for tests thus far. Lighthouse is always using the code above to convert from a BeaconBlockRef
to a NewPayloadRequest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to this: ethereum/consensus-specs#3454
it's a pain point for lodestar I guess, has it impacted our tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just here to make some testing code (which currently doesn't bother to test post-merge forks) more concise. It only impacts some merge fork tests (thus the error condition isn't triggered). There's TODO
's in the code to consider making those tests fork-aware / test multiple forks. I we decide to do that, this code will be revisited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's only used in tests, I wonder if it's worth adding #[cfg(test)]
to make it more explicit and ensure we don't later use this in production code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we don't have our code structured that way. It's used in the mock_execution_engine
as well as the execution engine integration tests. I believe the later isn't run with cfg(test)
enabled. Fixing up these tests is beyond the scope of this PR. I'd be happy to look into doing this but I'm not sure it should be done before we get deneb-free-blobs
merged into unstable
as it would only make the review even worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it stands it's not really the worst thing in the world. I would be worried if it were a panic but an error isn't bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah that wouldn't work for integration tests, got it thanks :)
I think we may also need to add the lighthouse/beacon_node/execution_layer/src/engine_api/http.rs Lines 1144 to 1156 in 6ef151a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! A few things:
- I think we should bump the EF tests in the PR to get CI working Add Deneb spec tests for v1.4.0-beta.0 #4519
- I don't see these p2p changes in attestation verification: https://github.com/ethereum/consensus-specs/pull/3360/files#diff-21cd1dde2a4815e714ef42d0cefa1bbd2997a4358ecf6e9e51025332c1d642fd
- I think we need to adjust
verify_propagation_slot_range
by ditchingATTESTATION_PROPAGATION_SLOT_RANGE
for deneb
- I think we need to adjust
- After implementing 4778, do you have any thoughts about this? I think they are trying to get more CL feedback about whether to merge it. Whatever is easiest, preferable on our end Move parent_beacon_block_root in execution payload and update verification ethereum/consensus-specs#3454
- We need to update voluntary exit signing in the account manager as well: https://github.com/sigp/lighthouse/blob/stable/account_manager/src/validator/exit.rs
} else { | ||
// TODO: determine an actual heuristic for when we take the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we just make this BUILDER_PROFIT_THRESHOLD
configurable (we should rename it though because we already have a --builder-profit-threshold
flag) and expose it with a flag, this seems like enough for now. We could also just make it a binary option to listen to the EL suggestion or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is something we necessarily want to treat in the same way as the --builder-profit-threshold
setting. It's a difficult question of when do we listen to the execution layer for overriding the builder. I put this trivial mechanism in purely as a safety measure so users won't lose a super valuable block. I think there needs to be more discussion around this involving both EL & CL before we decide how to properly deal with this.
There was a problem hiding this 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 just ignore should_override_builder
for now then, and maybe just log a warning until we have a better idea of how we should interpret it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay I've updated this to have a new flag:
ignore-builder-override-suggestion-threshold
which is a percentage difference to be exceeded by the builder payload in order to override this. I gave it a default value of 10%
consensus/state_processing/src/per_block_processing/verify_attestation.rs
Show resolved
Hide resolved
Oh good point, we also need to update voluntary exit signing in the VC API: lighthouse/validator_client/src/validator_store.rs Lines 663 to 670 in 6ef151a
|
9fa5e27
to
4b47258
Compare
4ebd3db
to
9585d41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the consensus changes for EIP-7045 are very minor but end up creating a decent amount of code duplication. I'm wondering if we think it's worth making an effort to try to reduce the duplication to make it easier to review on the deneb merge to unstable. If not I think we should probably make it a bit easier to understand what exactly about these methods should be different, maybe by pointing out specifics in method docs. What are your thoughts?
@@ -666,7 +666,19 @@ impl<T: SlotClock + 'static, E: EthSpec> ValidatorStore<T, E> { | |||
voluntary_exit: VoluntaryExit, | |||
) -> Result<SignedVoluntaryExit, Error> { | |||
let signing_epoch = voluntary_exit.epoch; | |||
let signing_context = self.signing_context(Domain::VoluntaryExit, signing_epoch); | |||
let mut signing_context = self.signing_context(Domain::VoluntaryExit, signing_epoch); | |||
match self.spec.fork_name_at_epoch(signing_epoch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it's worth moving this logic to the self.signing_context()
method? in case it's ever used elsewhere with Domain::VoluntaryExit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i can do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BeaconState::Base(_) | ||
| BeaconState::Altair(_) | ||
| BeaconState::Merge(_) | ||
| BeaconState::Capella(_) => spec.get_domain( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the other comment - should we move fork specific logic into spec.get_domain
so that other potential usages with the voluntary exit domain don't break? Since we pass in fork I think we have enough info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this case because get_domain
is a spec-defined function & changes of this type are done via bypassing this function to instead go straight to compute_domain
. Compare process_voluntary_exit
in:
this puts the change in the spec in approximately the same place as the change in our code and makes our code more spec-conformant overall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! Makes sense
beacon_node/src/cli.rs
Outdated
EE may make this suggestion depend on the EE's implementation, with the \ | ||
primary intent being to safeguard against potential censorship attacks \ | ||
from builders. Setting this flag to 0 will cause Lighthouse to always \ | ||
ignore the EE's suggestion. Default: 10 (equivalent to 10%).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this parses to an f32
, this would also accept decimals right? might be worth making that explict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also kind of annoyed by the code duplication, however I think the code is significantly more readable. If attestation processing has changed in As far as removing some duplication, I suppose you could make the argument for making
I can add comments to the functions if that's what you mean |
e0106ff
to
82b3ed4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We're testing some testing networking stuff on devnet 7 still so I think we should wait to merge this for a bit |
There's a couple merge conflicts, but I can make a |
alright I believe I've gotten rid of the duplicated code :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue Addressed
shouldOverrideBuilder
flag toengine_getPayloadV3
response #4487data_gas
toblob_gas
#4560Reviewing this PR is probably easiest by reviewing the individual commits as they are self-contained.