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
be3018b7
Unverified
Commit
be3018b7
authored
Aug 11, 2023
by
OptimismBot
Committed by
GitHub
Aug 11, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6737 from ethereum-optimism/inphi/devnet-err
bedrock-devnet: Handle exceptions in child processes
parents
e724034e
b9ae3777
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
__init__.py
bedrock-devnet/devnet/__init__.py
+25
-2
No files found.
bedrock-devnet/devnet/__init__.py
View file @
be3018b7
...
@@ -9,7 +9,7 @@ import datetime
...
@@ -9,7 +9,7 @@ import datetime
import
time
import
time
import
shutil
import
shutil
import
http.client
import
http.client
import
multiprocessing
from
multiprocessing
import
Process
,
Queue
import
devnet.log_setup
import
devnet.log_setup
...
@@ -25,6 +25,26 @@ class Bunch:
...
@@ -25,6 +25,26 @@ class Bunch:
def
__init__
(
self
,
**
kwds
):
def
__init__
(
self
,
**
kwds
):
self
.
__dict__
.
update
(
kwds
)
self
.
__dict__
.
update
(
kwds
)
class
ChildProcess
:
def
__init__
(
self
,
func
,
*
args
):
self
.
errq
=
Queue
()
self
.
process
=
Process
(
target
=
self
.
_func
,
args
=
(
func
,
args
))
def
_func
(
self
,
func
,
args
):
try
:
func
(
*
args
)
except
Exception
as
e
:
self
.
errq
.
put
(
str
(
e
))
def
start
(
self
):
self
.
process
.
start
()
def
join
(
self
):
self
.
process
.
join
()
def
get_error
(
self
):
return
self
.
errq
.
get
()
if
not
self
.
errq
.
empty
()
else
None
def
main
():
def
main
():
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
@@ -103,9 +123,12 @@ def devnet_l1_genesis(paths):
...
@@ -103,9 +123,12 @@ def devnet_l1_genesis(paths):
'--verbosity'
,
'4'
,
'--gcmode'
,
'archive'
,
'--dev.gaslimit'
,
'30000000'
'--verbosity'
,
'4'
,
'--gcmode'
,
'archive'
,
'--dev.gaslimit'
,
'30000000'
])
])
forge
=
multiprocessing
.
Process
(
target
=
deploy_contracts
,
args
=
(
paths
,)
)
forge
=
ChildProcess
(
deploy_contracts
,
paths
)
forge
.
start
()
forge
.
start
()
forge
.
join
()
forge
.
join
()
err
=
forge
.
get_error
()
if
err
:
raise
Exception
(
f
"Exception occurred in child process: {err}"
)
res
=
debug_dumpBlock
(
'127.0.0.1:8545'
)
res
=
debug_dumpBlock
(
'127.0.0.1:8545'
)
response
=
json
.
loads
(
res
)
response
=
json
.
loads
(
res
)
...
...
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