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
ab8223d1
Unverified
Commit
ab8223d1
authored
Jan 18, 2022
by
Javed Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add flag for sequencer client http url
parent
66481ca9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
4 deletions
+23
-4
main.go
l2geth/cmd/geth/main.go
+1
-0
usage.go
l2geth/cmd/geth/usage.go
+1
-0
flags.go
l2geth/cmd/utils/flags.go
+9
-0
api_backend.go
l2geth/eth/api_backend.go
+4
-0
api.go
l2geth/internal/ethapi/api.go
+1
-4
backend.go
l2geth/internal/ethapi/backend.go
+1
-0
api_backend.go
l2geth/les/api_backend.go
+4
-0
config.go
l2geth/rollup/config.go
+2
-0
No files found.
l2geth/cmd/geth/main.go
View file @
ab8223d1
...
@@ -163,6 +163,7 @@ var (
...
@@ -163,6 +163,7 @@ var (
utils
.
RollupEnforceFeesFlag
,
utils
.
RollupEnforceFeesFlag
,
utils
.
RollupFeeThresholdDownFlag
,
utils
.
RollupFeeThresholdDownFlag
,
utils
.
RollupFeeThresholdUpFlag
,
utils
.
RollupFeeThresholdUpFlag
,
utils
.
SequencerClientHttpFlag
,
}
}
rpcFlags
=
[]
cli
.
Flag
{
rpcFlags
=
[]
cli
.
Flag
{
...
...
l2geth/cmd/geth/usage.go
View file @
ab8223d1
...
@@ -77,6 +77,7 @@ var AppHelpFlagGroups = []flagGroup{
...
@@ -77,6 +77,7 @@ var AppHelpFlagGroups = []flagGroup{
utils
.
RollupEnforceFeesFlag
,
utils
.
RollupEnforceFeesFlag
,
utils
.
RollupFeeThresholdDownFlag
,
utils
.
RollupFeeThresholdDownFlag
,
utils
.
RollupFeeThresholdUpFlag
,
utils
.
RollupFeeThresholdUpFlag
,
utils
.
SequencerClientHttpFlag
,
},
},
},
},
{
{
...
...
l2geth/cmd/utils/flags.go
View file @
ab8223d1
...
@@ -861,6 +861,12 @@ var (
...
@@ -861,6 +861,12 @@ var (
Usage
:
"Allow txs with fees above the current fee up to this amount, must be > 1"
,
Usage
:
"Allow txs with fees above the current fee up to this amount, must be > 1"
,
EnvVar
:
"ROLLUP_FEE_THRESHOLD_UP"
,
EnvVar
:
"ROLLUP_FEE_THRESHOLD_UP"
,
}
}
SequencerClientHttpFlag
=
cli
.
StringFlag
{
Name
:
"sequencer.clienthttp"
,
Usage
:
"HTTP endpoint for the sequencer client"
,
Value
:
"http://l2geth:8545"
,
EnvVar
:
"SEQUENCER_CLIENT_HTTP"
,
}
)
)
// MakeDataDir retrieves the currently requested data directory, terminating
// MakeDataDir retrieves the currently requested data directory, terminating
...
@@ -1137,6 +1143,9 @@ func setRollup(ctx *cli.Context, cfg *rollup.Config) {
...
@@ -1137,6 +1143,9 @@ func setRollup(ctx *cli.Context, cfg *rollup.Config) {
val
:=
ctx
.
GlobalFloat64
(
RollupFeeThresholdUpFlag
.
Name
)
val
:=
ctx
.
GlobalFloat64
(
RollupFeeThresholdUpFlag
.
Name
)
cfg
.
FeeThresholdUp
=
new
(
big
.
Float
)
.
SetFloat64
(
val
)
cfg
.
FeeThresholdUp
=
new
(
big
.
Float
)
.
SetFloat64
(
val
)
}
}
if
ctx
.
GlobalIsSet
(
SequencerClientHttpFlag
.
Name
)
{
cfg
.
SequencerClientHttp
=
ctx
.
GlobalString
(
SequencerClientHttpFlag
.
Name
)
}
}
}
// setLes configures the les server and ultra light client settings from the command line flags.
// setLes configures the les server and ultra light client settings from the command line flags.
...
...
l2geth/eth/api_backend.go
View file @
ab8223d1
...
@@ -136,6 +136,10 @@ func (b *EthAPIBackend) IngestTransactions(txs []*types.Transaction) error {
...
@@ -136,6 +136,10 @@ func (b *EthAPIBackend) IngestTransactions(txs []*types.Transaction) error {
return
nil
return
nil
}
}
func
(
b
*
EthAPIBackend
)
SequencerClientHttp
()
string
{
return
b
.
eth
.
config
.
Rollup
.
SequencerClientHttp
}
func
(
b
*
EthAPIBackend
)
HeaderByNumber
(
ctx
context
.
Context
,
number
rpc
.
BlockNumber
)
(
*
types
.
Header
,
error
)
{
func
(
b
*
EthAPIBackend
)
HeaderByNumber
(
ctx
context
.
Context
,
number
rpc
.
BlockNumber
)
(
*
types
.
Header
,
error
)
{
// Pending block is only known by the miner
// Pending block is only known by the miner
if
number
==
rpc
.
PendingBlockNumber
{
if
number
==
rpc
.
PendingBlockNumber
{
...
...
l2geth/internal/ethapi/api.go
View file @
ab8223d1
...
@@ -1659,11 +1659,8 @@ func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encod
...
@@ -1659,11 +1659,8 @@ func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encod
return
common
.
Hash
{},
errors
.
New
(
"Cannot send raw transaction while syncing"
)
return
common
.
Hash
{},
errors
.
New
(
"Cannot send raw transaction while syncing"
)
}
}
// Forward tx to sequencer if config is set
// TODO: add forwarding config
if
s
.
b
.
IsVerifier
()
{
if
s
.
b
.
IsVerifier
()
{
// TODO: replace with env var L2_URL
client
,
err
:=
ethclient
.
Dial
(
s
.
b
.
SequencerClientHttp
())
client
,
err
:=
ethclient
.
Dial
(
"http://l2geth:8545"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
common
.
Hash
{},
err
return
common
.
Hash
{},
err
}
}
...
...
l2geth/internal/ethapi/backend.go
View file @
ab8223d1
...
@@ -96,6 +96,7 @@ type Backend interface {
...
@@ -96,6 +96,7 @@ type Backend interface {
SuggestL2GasPrice
(
context
.
Context
)
(
*
big
.
Int
,
error
)
SuggestL2GasPrice
(
context
.
Context
)
(
*
big
.
Int
,
error
)
SetL2GasPrice
(
context
.
Context
,
*
big
.
Int
)
error
SetL2GasPrice
(
context
.
Context
,
*
big
.
Int
)
error
IngestTransactions
([]
*
types
.
Transaction
)
error
IngestTransactions
([]
*
types
.
Transaction
)
error
SequencerClientHttp
()
string
}
}
func
GetAPIs
(
apiBackend
Backend
)
[]
rpc
.
API
{
func
GetAPIs
(
apiBackend
Backend
)
[]
rpc
.
API
{
...
...
l2geth/les/api_backend.go
View file @
ab8223d1
...
@@ -86,6 +86,10 @@ func (b *LesApiBackend) IngestTransactions([]*types.Transaction) error {
...
@@ -86,6 +86,10 @@ func (b *LesApiBackend) IngestTransactions([]*types.Transaction) error {
panic
(
"not implemented"
)
panic
(
"not implemented"
)
}
}
func
(
b
*
LesApiBackend
)
SequencerClientHttp
()
string
{
return
b
.
eth
.
config
.
Rollup
.
SequencerClientHttp
}
func
(
b
*
LesApiBackend
)
HeaderByNumber
(
ctx
context
.
Context
,
number
rpc
.
BlockNumber
)
(
*
types
.
Header
,
error
)
{
func
(
b
*
LesApiBackend
)
HeaderByNumber
(
ctx
context
.
Context
,
number
rpc
.
BlockNumber
)
(
*
types
.
Header
,
error
)
{
if
number
==
rpc
.
LatestBlockNumber
||
number
==
rpc
.
PendingBlockNumber
{
if
number
==
rpc
.
LatestBlockNumber
||
number
==
rpc
.
PendingBlockNumber
{
return
b
.
eth
.
blockchain
.
CurrentHeader
(),
nil
return
b
.
eth
.
blockchain
.
CurrentHeader
(),
nil
...
...
l2geth/rollup/config.go
View file @
ab8223d1
...
@@ -37,4 +37,6 @@ type Config struct {
...
@@ -37,4 +37,6 @@ type Config struct {
// quoted and the transaction being executed
// quoted and the transaction being executed
FeeThresholdDown
*
big
.
Float
FeeThresholdDown
*
big
.
Float
FeeThresholdUp
*
big
.
Float
FeeThresholdUp
*
big
.
Float
// HTTP endpoint of the sequencer
SequencerClientHttp
string
}
}
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