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
91faf2c5
Unverified
Commit
91faf2c5
authored
Apr 04, 2023
by
Péter Szilágyi
Committed by
GitHub
Apr 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
consensus, core/typer: add 4844 excessDataGas to header, tie it to Cancun (#27046)
parent
9b1a82c6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
consensus.go
consensus/beacon/consensus.go
+9
-1
clique.go
consensus/clique/clique.go
+3
-0
consensus.go
consensus/ethash/consensus.go
+3
-0
block.go
core/types/block.go
+3
-0
No files found.
consensus/beacon/consensus.go
View file @
91faf2c5
...
...
@@ -263,11 +263,19 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa
// Verify existence / non-existence of withdrawalsHash.
shanghai
:=
chain
.
Config
()
.
IsShanghai
(
header
.
Time
)
if
shanghai
&&
header
.
WithdrawalsHash
==
nil
{
return
fmt
.
Errorf
(
"missing withdrawalsHash"
)
return
errors
.
New
(
"missing withdrawalsHash"
)
}
if
!
shanghai
&&
header
.
WithdrawalsHash
!=
nil
{
return
fmt
.
Errorf
(
"invalid withdrawalsHash: have %x, expected nil"
,
header
.
WithdrawalsHash
)
}
// Verify the existence / non-existence of excessDataGas
cancun
:=
chain
.
Config
()
.
IsCancun
(
header
.
Time
)
if
cancun
&&
header
.
ExcessDataGas
==
nil
{
return
errors
.
New
(
"missing excessDataGas"
)
}
if
!
cancun
&&
header
.
ExcessDataGas
!=
nil
{
return
fmt
.
Errorf
(
"invalid excessDataGas: have %d, expected nil"
,
header
.
ExcessDataGas
)
}
return
nil
}
...
...
consensus/clique/clique.go
View file @
91faf2c5
...
...
@@ -301,6 +301,9 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
if
chain
.
Config
()
.
IsShanghai
(
header
.
Time
)
{
return
fmt
.
Errorf
(
"clique does not support shanghai fork"
)
}
if
chain
.
Config
()
.
IsCancun
(
header
.
Time
)
{
return
fmt
.
Errorf
(
"clique does not support cancun fork"
)
}
// If all checks passed, validate any special fields for hard forks
if
err
:=
misc
.
VerifyForkHashes
(
chain
.
Config
(),
header
,
false
);
err
!=
nil
{
return
err
...
...
consensus/ethash/consensus.go
View file @
91faf2c5
...
...
@@ -313,6 +313,9 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
if
chain
.
Config
()
.
IsShanghai
(
header
.
Time
)
{
return
fmt
.
Errorf
(
"ethash does not support shanghai fork"
)
}
if
chain
.
Config
()
.
IsCancun
(
header
.
Time
)
{
return
fmt
.
Errorf
(
"ethash does not support cancun fork"
)
}
// Verify the engine specific seal securing the block
if
seal
{
if
err
:=
ethash
.
verifySeal
(
chain
,
header
,
false
);
err
!=
nil
{
...
...
core/types/block.go
View file @
91faf2c5
...
...
@@ -85,6 +85,9 @@ type Header struct {
// WithdrawalsHash was added by EIP-4895 and is ignored in legacy headers.
WithdrawalsHash
*
common
.
Hash
`json:"withdrawalsRoot" rlp:"optional"`
// ExcessDataGas was added by EIP-4844 and is ignored in legacy headers.
ExcessDataGas
*
big
.
Int
`json:"excessDataGas" rlp:"optional"`
/*
TODO (MariusVanDerWijden) Add this field once needed
// Random was added during the merge and contains the BeaconState randomness
...
...
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