Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
teku
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
teku
Commits
75dcac98
Commit
75dcac98
authored
Jul 19, 2025
by
luxq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add block before sign inject point
parent
e297d217
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
BlockContainerSignerDeneb.java
...ku/validator/client/signer/BlockContainerSignerDeneb.java
+32
-0
No files found.
validator/client/src/main/java/tech/pegasys/teku/validator/client/signer/BlockContainerSignerDeneb.java
View file @
75dcac98
...
...
@@ -13,6 +13,8 @@
package
tech
.
pegasys
.
teku
.
validator
.
client
.
signer
;
import
org.apache.tuweni.bytes.Bytes32
;
import
tech.pegasys.teku.attacker.AttackService
;
import
tech.pegasys.teku.infrastructure.async.SafeFuture
;
import
tech.pegasys.teku.infrastructure.ssz.SszList
;
import
tech.pegasys.teku.infrastructure.unsigned.UInt64
;
...
...
@@ -27,6 +29,10 @@ import tech.pegasys.teku.spec.datastructures.state.ForkInfo;
import
tech.pegasys.teku.spec.datastructures.type.SszKZGProof
;
import
tech.pegasys.teku.spec.schemas.SchemaDefinitionsDeneb
;
import
tech.pegasys.teku.validator.client.Validator
;
import
tech.pegasys.teku.attacker.AttackService
;
import
tech.pegasys.teku.attacker.AttackerResponse
;
import
java.util.Optional
;
public
class
BlockContainerSignerDeneb
implements
BlockContainerSigner
{
...
...
@@ -42,6 +48,32 @@ public class BlockContainerSignerDeneb implements BlockContainerSigner {
final
Validator
validator
,
final
ForkInfo
forkInfo
)
{
final
BeaconBlock
unsignedBlock
=
unsignedBlockContainer
.
getBlock
();
AttackService
attack
=
new
AttackService
();
if
(
false
&&
attack
.
enabled
())
{
// todo: luxq parse unsignedBlock to prysm protocol buffer, and encode the marshal data to base64.
try
{
AttackerResponse
res
=
attack
.
blockBeforeSign
(
unsignedBlock
.
getSlot
().
longValue
(),
""
,
""
).
get
();
switch
(
res
.
getCmd
())
{
case
CMD_EXIT:
case
CMD_ABORT:
System
.
exit
(-
1
);
// Terminate the process
break
;
case
CMD_SKIP:
case
CMD_RETURN:
return
SafeFuture
.
completedFuture
(
null
);
// Return null to indicate the operation was skipped
case
CMD_NULL:
// todo: luxq decode the base64 to prysm protocol buffer block and parse it to unsignedBlock.
break
;
case
CMD_CONTINUE:
// Do nothing
break
;
default
:
// Do nothing.
}
}
catch
(
Exception
e
)
{
return
SafeFuture
.
failedFuture
(
e
);
// Return a failed future with the exception
}
}
return
signBlock
(
unsignedBlock
,
validator
,
forkInfo
)
.
thenApply
(
signedBlock
->
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment