Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
f56ee7d9
Unverified
Commit
f56ee7d9
authored
Aug 21, 2023
by
jwasinger
Committed by
GitHub
Aug 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/catalyst: set finalized block hash properly in dev mode (#27886)
Co-authored-by:
Martin Holst Swende
<
martin@swende.se
>
parent
b3024e8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
simulated_beacon.go
eth/catalyst/simulated_beacon.go
+10
-1
No files found.
eth/catalyst/simulated_beacon.go
View file @
f56ee7d9
...
...
@@ -32,6 +32,8 @@ import (
"github.com/ethereum/go-ethereum/rpc"
)
const
devEpochLength
=
32
// withdrawalQueue implements a FIFO queue which holds withdrawals that are
// pending inclusion.
type
withdrawalQueue
struct
{
...
...
@@ -157,6 +159,13 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
}
payload
:=
envelope
.
ExecutionPayload
var
finalizedHash
common
.
Hash
if
payload
.
Number
%
devEpochLength
==
0
{
finalizedHash
=
payload
.
BlockHash
}
else
{
finalizedHash
=
c
.
eth
.
BlockChain
()
.
GetBlockByNumber
((
payload
.
Number
-
1
)
/
devEpochLength
*
devEpochLength
)
.
Hash
()
}
// mark the payload as canon
if
_
,
err
=
c
.
engineAPI
.
NewPayloadV2
(
*
payload
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to mark payload as canonical: %v"
,
err
)
...
...
@@ -164,7 +173,7 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
c
.
curForkchoiceState
=
engine
.
ForkchoiceStateV1
{
HeadBlockHash
:
payload
.
BlockHash
,
SafeBlockHash
:
payload
.
BlockHash
,
FinalizedBlockHash
:
payload
.
Block
Hash
,
FinalizedBlockHash
:
finalized
Hash
,
}
// mark the block containing the payload as canonical
if
_
,
err
=
c
.
engineAPI
.
ForkchoiceUpdatedV2
(
c
.
curForkchoiceState
,
nil
);
err
!=
nil
{
...
...
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