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
43d50c87
Commit
43d50c87
authored
Jan 17, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move `address` padding bytes into a named var
parent
c6c758c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
system_config.go
op-node/rollup/derive/system_config.go
+4
-1
No files found.
op-node/rollup/derive/system_config.go
View file @
43d50c87
...
...
@@ -34,6 +34,9 @@ var OneWordUint = common.Hash{31: 32}
// 24 zero bytes (the padding for a uint64 in a 32 byte word)
var
Uint64Padding
=
make
([]
byte
,
24
)
// 12 zero bytes (the padding for an Ethereum address in a 32 byte word)
var
AddressPadding
=
make
([]
byte
,
12
)
var
logger
=
log
.
New
(
"derive"
,
"system_config"
)
// UpdateSystemConfigWithL1Receipts filters all L1 receipts to find config updates and applies the config updates to the given sysCfg
...
...
@@ -112,7 +115,7 @@ func ProcessSystemConfigUpdateLogEvent(destSysCfg *eth.SystemConfig, ev *types.L
// Indexing `word` directly is always safe here, it is guaranteed to be 32 bytes in length.
// Check that the batcher address is correctly zero-padded.
word
:=
readWord
()
if
!
bytes
.
Equal
(
word
[
:
12
],
make
([]
byte
,
12
)
)
{
if
!
bytes
.
Equal
(
word
[
:
12
],
AddressPadding
)
{
return
fmt
.
Errorf
(
"expected version 0 batcher hash with zero padding, but got %x"
,
word
)
}
destSysCfg
.
BatcherAddr
.
SetBytes
(
word
[
12
:
])
...
...
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