Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
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
exchain
nebula
Commits
55f603e4
Commit
55f603e4
authored
Nov 06, 2023
by
Joshua Gutow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-service/eth: Expose GasLimit from the header in BlockInfo
parent
6cce3728
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
block_info.go
op-service/eth/block_info.go
+5
-0
types.go
op-service/sources/types.go
+4
-0
l1info.go
op-service/testutils/l1info.go
+5
-0
No files found.
op-service/eth/block_info.go
View file @
55f603e4
...
...
@@ -20,6 +20,7 @@ type BlockInfo interface {
BaseFee
()
*
big
.
Int
ReceiptHash
()
common
.
Hash
GasUsed
()
uint64
GasLimit
()
uint64
// HeaderRLP returns the RLP of the block header as per consensus rules
// Returns an error if the header RLP could not be written
...
...
@@ -100,6 +101,10 @@ func (h headerBlockInfo) GasUsed() uint64 {
return
h
.
Header
.
GasUsed
}
func
(
h
headerBlockInfo
)
GasLimit
()
uint64
{
return
h
.
Header
.
GasLimit
}
func
(
h
headerBlockInfo
)
HeaderRLP
()
([]
byte
,
error
)
{
return
rlp
.
EncodeToBytes
(
h
.
Header
)
}
...
...
op-service/sources/types.go
View file @
55f603e4
...
...
@@ -78,6 +78,10 @@ func (h headerInfo) GasUsed() uint64 {
return
h
.
Header
.
GasUsed
}
func
(
h
headerInfo
)
GasLimit
()
uint64
{
return
h
.
Header
.
GasLimit
}
func
(
h
headerInfo
)
HeaderRLP
()
([]
byte
,
error
)
{
return
rlp
.
EncodeToBytes
(
h
.
Header
)
}
...
...
op-service/testutils/l1info.go
View file @
55f603e4
...
...
@@ -23,6 +23,7 @@ type MockBlockInfo struct {
InfoBaseFee
*
big
.
Int
InfoReceiptRoot
common
.
Hash
InfoGasUsed
uint64
InfoGasLimit
uint64
InfoHeaderRLP
[]
byte
}
...
...
@@ -66,6 +67,10 @@ func (l *MockBlockInfo) GasUsed() uint64 {
return
l
.
InfoGasUsed
}
func
(
l
*
MockBlockInfo
)
GasLimit
()
uint64
{
return
l
.
InfoGasLimit
}
func
(
l
*
MockBlockInfo
)
ID
()
eth
.
BlockID
{
return
eth
.
BlockID
{
Hash
:
l
.
InfoHash
,
Number
:
l
.
InfoNum
}
}
...
...
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