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
6a839b18
Unverified
Commit
6a839b18
authored
Mar 25, 2022
by
smartcontracts
Committed by
GitHub
Mar 25, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2370 from ethereum-optimism/sc/config-genesis-timeout
feat(l2geth): add configurable genesis timeout
parents
452f5e0c
6926b293
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
5 deletions
+19
-5
tiny-melons-float.md
.changeset/tiny-melons-float.md
+5
-0
chaincmd.go
l2geth/cmd/geth/chaincmd.go
+5
-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
+6
-0
package.json
packages/contracts/package.json
+1
-1
No files found.
.changeset/tiny-melons-float.md
0 → 100644
View file @
6a839b18
---
'
@eth-optimism/l2geth'
:
patch
---
Adds a flag for changing the genesis fetch timeout
l2geth/cmd/geth/chaincmd.go
View file @
6a839b18
...
...
@@ -56,6 +56,7 @@ var (
ArgsUsage
:
"<genesisPathOrUrl> (<genesisHash>)"
,
Flags
:
[]
cli
.
Flag
{
utils
.
DataDirFlag
,
utils
.
RollupGenesisTimeoutSecondsFlag
,
},
Category
:
"BLOCKCHAIN COMMANDS"
,
Description
:
`
...
...
@@ -236,7 +237,7 @@ func initGenesis(ctx *cli.Context) error {
log
.
Info
(
"Fetching genesis file"
,
"url"
,
genesisPathOrURL
)
genesisData
,
err
:=
fetchGenesis
(
genesisPathOrURL
)
genesisData
,
err
:=
fetchGenesis
(
genesisPathOrURL
,
time
.
Duration
(
ctx
.
GlobalInt
(
utils
.
RollupGenesisTimeoutSecondsFlag
.
Name
))
)
if
err
!=
nil
{
utils
.
Fatalf
(
"Failed to fetch genesis file: %v"
,
err
)
}
...
...
@@ -640,9 +641,9 @@ func hashish(x string) bool {
return
err
!=
nil
}
func
fetchGenesis
(
url
string
)
([]
byte
,
error
)
{
func
fetchGenesis
(
url
string
,
timeout
time
.
Duration
)
([]
byte
,
error
)
{
client
:=
&
http
.
Client
{
Timeout
:
60
*
time
.
Second
,
Timeout
:
timeout
,
}
resp
,
err
:=
client
.
Get
(
url
)
if
err
!=
nil
{
...
...
l2geth/cmd/geth/main.go
View file @
6a839b18
...
...
@@ -163,6 +163,7 @@ var (
utils
.
RollupEnforceFeesFlag
,
utils
.
RollupFeeThresholdDownFlag
,
utils
.
RollupFeeThresholdUpFlag
,
utils
.
RollupGenesisTimeoutSecondsFlag
,
utils
.
SequencerClientHttpFlag
,
utils
.
TxPublisherEnableFlag
,
utils
.
TxPublisherProjectIDFlag
,
...
...
l2geth/cmd/geth/usage.go
View file @
6a839b18
...
...
@@ -77,6 +77,7 @@ var AppHelpFlagGroups = []flagGroup{
utils
.
RollupEnforceFeesFlag
,
utils
.
RollupFeeThresholdDownFlag
,
utils
.
RollupFeeThresholdUpFlag
,
utils
.
RollupGenesisTimeoutSecondsFlag
,
utils
.
SequencerClientHttpFlag
,
utils
.
TxPublisherEnableFlag
,
utils
.
TxPublisherProjectIDFlag
,
...
...
l2geth/cmd/utils/flags.go
View file @
6a839b18
...
...
@@ -862,6 +862,12 @@ var (
Usage
:
"Allow txs with fees above the current fee up to this amount, must be > 1"
,
EnvVar
:
"ROLLUP_FEE_THRESHOLD_UP"
,
}
RollupGenesisTimeoutSecondsFlag
=
cli
.
DurationFlag
{
Name
:
"rollup.genesistimeoutseconds"
,
Usage
:
"Timeout for the genesis file to be fetched"
,
Value
:
time
.
Second
*
60
,
EnvVar
:
"ROLLUP_GENESIS_TIMEOUT_SECONDS"
,
}
SequencerClientHttpFlag
=
cli
.
StringFlag
{
Name
:
"sequencer.clienthttp"
,
Usage
:
"HTTP endpoint for the sequencer client"
,
...
...
packages/contracts/package.json
View file @
6a839b18
...
...
@@ -23,7 +23,7 @@
"autogen:markdown"
:
"ts-node scripts/generate-markdown.ts"
,
"autogen:artifacts"
:
"ts-node scripts/generate-artifacts.ts && ts-node scripts/generate-deployed-artifacts.ts"
,
"test"
:
"yarn test:contracts"
,
"test:contracts"
:
"hardhat test --show-stack-traces
--parallel
"
,
"test:contracts"
:
"hardhat test --show-stack-traces"
,
"test:coverage"
:
"NODE_OPTIONS=--max_old_space_size=8192 hardhat coverage && istanbul check-coverage --statements 90 --branches 84 --functions 88 --lines 90"
,
"test:slither"
:
"slither ."
,
"pretest:slither"
:
"rm -f @openzeppelin && rm -f @ens && rm -f hardhat && ln -s ../../node_modules/@openzeppelin @openzeppelin && ln -s ../../node_modules/@ens @ens && ln -s ../../node_modules/hardhat hardhat"
,
...
...
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