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
b151d50d
Commit
b151d50d
authored
Feb 02, 2023
by
Sebastian Stammler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-batcher: Start SequencerWindow timeout tracking (WIP)
parent
32dc4735
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
channel_builder.go
op-batcher/batcher/channel_builder.go
+21
-2
driver.go
op-batcher/batcher/driver.go
+6
-0
No files found.
op-batcher/batcher/channel_builder.go
View file @
b151d50d
...
...
@@ -20,6 +20,9 @@ type (
// L1 block timestamp of channel timeout. 0 if no timeout set yet.
timeout
uint64
// sequencer window timeout block. 0 if not set yet.
swTimeoutBlock
uint64
// marked as full if a) max RLP input bytes, b) max num frames or c) max
// allowed frame index (uint16) has been reached
fullErr
error
...
...
@@ -32,6 +35,9 @@ type (
}
ChannelConfig
struct
{
// Number of epochs (L1 blocks) per sequencing window, including the epoch
// L1 origin block itself
SeqWindowSize
uint64
// The maximum number of L1 blocks that the inclusion transactions of a
// channel's frames can span.
ChannelTimeout
uint64
...
...
@@ -158,14 +164,19 @@ func (c *channelBuilder) AddBlock(block *types.Block) error {
return
c
.
FullErr
()
}
_
,
err
:=
c
.
co
.
AddBlock
(
block
)
if
errors
.
Is
(
err
,
derive
.
ErrTooManyRLPBytes
)
{
batch
,
err
:=
derive
.
BlockToBatch
(
block
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"converting block to batch: %w"
,
err
)
}
if
_
,
err
=
c
.
co
.
AddBatch
(
batch
);
errors
.
Is
(
err
,
derive
.
ErrTooManyRLPBytes
)
{
c
.
setFullErr
(
err
)
return
c
.
FullErr
()
}
else
if
err
!=
nil
{
return
fmt
.
Errorf
(
"adding block to channel out: %w"
,
err
)
}
c
.
blocks
=
append
(
c
.
blocks
,
block
)
c
.
updateSwTimeout
(
batch
)
if
c
.
InputTargetReached
()
{
c
.
setFullErr
(
ErrInputTargetReached
)
...
...
@@ -175,6 +186,14 @@ func (c *channelBuilder) AddBlock(block *types.Block) error {
return
nil
}
func
(
c
*
channelBuilder
)
updateSwTimeout
(
batch
*
derive
.
BatchData
)
{
if
c
.
swTimeoutBlock
!=
0
{
return
}
// TODO: subtract safety margin
c
.
swTimeoutBlock
=
uint64
(
batch
.
EpochNum
)
+
c
.
cfg
.
SeqWindowSize
}
// InputTargetReached says whether the target amount of input data has been
// reached in this channel builder. No more blocks can be added afterwards.
func
(
c
*
channelBuilder
)
InputTargetReached
()
bool
{
...
...
op-batcher/batcher/driver.go
View file @
b151d50d
...
...
@@ -77,6 +77,11 @@ func NewBatchSubmitterFromCLIConfig(cfg CLIConfig, l log.Logger) (*BatchSubmitte
return
nil
,
err
}
rcfg
,
err
:=
rollupClient
.
RollupConfig
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
txManagerConfig
:=
txmgr
.
Config
{
ResubmissionTimeout
:
cfg
.
ResubmissionTimeout
,
ReceiptQueryInterval
:
time
.
Second
,
...
...
@@ -95,6 +100,7 @@ func NewBatchSubmitterFromCLIConfig(cfg CLIConfig, l log.Logger) (*BatchSubmitte
SignerFnFactory
:
signer
,
BatchInboxAddress
:
batchInboxAddress
,
Channel
:
ChannelConfig
{
SeqWindowSize
:
rcfg
.
SeqWindowSize
,
ChannelTimeout
:
cfg
.
ChannelTimeout
,
ChannelSubTimeout
:
cfg
.
ChannelSubTimeout
,
MaxFrameSize
:
cfg
.
MaxL1TxSize
-
1
,
// subtract 1 byte for version
...
...
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