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
4656d49a
Unverified
Commit
4656d49a
authored
Sep 11, 2024
by
Ratan Kaliani
Committed by
GitHub
Sep 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: export process frames (#11864)
parent
5cdcfd46
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
reassemble.go
op-node/cmd/batch_decoder/reassemble/reassemble.go
+4
-2
No files found.
op-node/cmd/batch_decoder/reassemble/reassemble.go
View file @
4656d49a
...
@@ -72,7 +72,7 @@ func Channels(config Config, rollupCfg *rollup.Config) {
...
@@ -72,7 +72,7 @@ func Channels(config Config, rollupCfg *rollup.Config) {
framesByChannel
[
frame
.
Frame
.
ID
]
=
append
(
framesByChannel
[
frame
.
Frame
.
ID
],
frame
)
framesByChannel
[
frame
.
Frame
.
ID
]
=
append
(
framesByChannel
[
frame
.
Frame
.
ID
],
frame
)
}
}
for
id
,
frames
:=
range
framesByChannel
{
for
id
,
frames
:=
range
framesByChannel
{
ch
:=
p
rocessFrames
(
config
,
rollupCfg
,
id
,
frames
)
ch
:=
P
rocessFrames
(
config
,
rollupCfg
,
id
,
frames
)
filename
:=
path
.
Join
(
config
.
OutDirectory
,
fmt
.
Sprintf
(
"%s.json"
,
id
.
String
()))
filename
:=
path
.
Join
(
config
.
OutDirectory
,
fmt
.
Sprintf
(
"%s.json"
,
id
.
String
()))
if
err
:=
writeChannel
(
ch
,
filename
);
err
!=
nil
{
if
err
:=
writeChannel
(
ch
,
filename
);
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
...
@@ -90,7 +90,9 @@ func writeChannel(ch ChannelWithMetadata, filename string) error {
...
@@ -90,7 +90,9 @@ func writeChannel(ch ChannelWithMetadata, filename string) error {
return
enc
.
Encode
(
ch
)
return
enc
.
Encode
(
ch
)
}
}
func
processFrames
(
cfg
Config
,
rollupCfg
*
rollup
.
Config
,
id
derive
.
ChannelID
,
frames
[]
FrameWithMetadata
)
ChannelWithMetadata
{
// ProcessFrames processes the frames for a given channel and reads batches and other relevant metadata
// from the channel. Returns a ChannelWithMetadata struct containing all the relevant data.
func
ProcessFrames
(
cfg
Config
,
rollupCfg
*
rollup
.
Config
,
id
derive
.
ChannelID
,
frames
[]
FrameWithMetadata
)
ChannelWithMetadata
{
spec
:=
rollup
.
NewChainSpec
(
rollupCfg
)
spec
:=
rollup
.
NewChainSpec
(
rollupCfg
)
ch
:=
derive
.
NewChannel
(
id
,
eth
.
L1BlockRef
{
Number
:
frames
[
0
]
.
InclusionBlock
})
ch
:=
derive
.
NewChannel
(
id
,
eth
.
L1BlockRef
{
Number
:
frames
[
0
]
.
InclusionBlock
})
invalidFrame
:=
false
invalidFrame
:=
false
...
...
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