-
Notifications
You must be signed in to change notification settings - Fork 313
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
Bellatrix fork + External Signer: Send block_header for block sign request #5354
Conversation
- Create BeaconBlockHeader from BeaconBlock - Update ExternalSigner for Bellatrix - Update SigningRootUtil to sign BeaconBlockHeader - Update BlockRequestBody to send block_header
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.
return spec.computeSigningRoot(block, getDomainForSignBlock(block.getSlot(), forkInfo)); | ||
} | ||
|
||
public Bytes signingRootForSignBlock( |
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.
Maybe call this signingRootForSignBlockHeader
?
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.
done.
+ block.getSlot() | ||
+ " as it may violate a slashing condition"; | ||
String.format( | ||
"External signed refused to sign block at slot %s as it may violate a slashing condition", |
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.
"External signed refused to sign block at slot %s as it may violate a slashing condition", | |
"External signer refused to sign block at slot %s as it may violate a slashing condition", |
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.
updated typo.
case ALTAIR: | ||
metadata.put( | ||
"beacon_block", | ||
new BlockRequestBody(spec.atSlot(block.getSlot()).getMilestone(), beaconBlock, null)); |
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.
It probably makes sense to have two separate constructors for BlockRequestBody
, one that takes just a beacon block and one that takes just a header. May still need the version that takes both for JSON deserialisation but would be nice to clean this up to not have to specify null.
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.
Done, introduced overloaded constructor. Also updated unit tests to assert correct fields are populated.
PR Description
For Bellatrix fork, send
block_header
instead ofblock
for external signer block signing request (BLOCK_V2
).block_header
containsbody_root
instead of complete beacon blockbody
which significantly reduces the traffic between Teku and external signer for block signing request.Either
block_header
orblock
can be used to calculate signing root by the external signer. For backward compatibility with PHASE0 and ALTAIR forks, onlyblock
is sent; for Bellatrix and later forks, onlyblock_header
is sent.Fixed Issue(s)
Consensys/web3signer#437
Documentation
doc-change-required
label to this PR if updates are required.Changelog