Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: op-deployer upgrade, fix fork support #88

Merged
merged 6 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,20 @@ optimism_package:
fjord_time_offset: 0

# Granite fork
# Defaults to None - not activated - decimal value
# Defaults to 0 (genesis activation) - decimal value
# Offset is in seconds
granite_time_offset: ""
granite_time_offset: 0

# Holocene fork
# Defaults to None - not activated - decimal value
# Offset is in seconds
holocene_time_offset: ""

# Isthmus fork
# Defaults to None - not activated - decimal value
# Offset is in seconds
isthmus_time_offset: ""

# Interop fork
# Defaults to None - not activated - decimal value
# Offset is in seconds
Expand All @@ -254,8 +259,9 @@ optimism_package:
# L2 contract deployer configuration - used for all L2 networks
# The docker image that should be used for the L2 contract deployer
op_contract_deployer_params:
image: mslipper/op-deployer:latest
artifacts_url: https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-4accd01f0c35c26f24d2aa71aba898dd7e5085a2ce5daadc8a84b10caf113409.tar.gz
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-deployer:v0.0.6
l1_artifacts_locator: tag://op-contracts/v1.6.0
l2_artifacts_locator: tag://op-contracts/v1.7.0-beta.1+l2-contracts

# The global log level that all clients should log at
# Valid values are "error", "warn", "info", "debug", and "trace"
Expand Down
9 changes: 4 additions & 5 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@ optimism_package:
seconds_per_slot: 2
name: "op-kurtosis"
fjord_time_offset: 0
granite_time_offset: ""
holocene_time_offset: ""
interop_time_offset: ""
granite_time_offset: 0
fund_dev_accounts: true
batcher_params:
image: ""
extra_params: []
additional_services: []
op_contract_deployer_params:
image: mslipper/op-deployer:latest
artifacts_url: https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-4accd01f0c35c26f24d2aa71aba898dd7e5085a2ce5daadc8a84b10caf113409.tar.gz
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-deployer:v0.0.6
mslipper marked this conversation as resolved.
Show resolved Hide resolved
l1_artifacts_locator: tag://op-contracts/v1.6.0
l2_artifacts_locator: tag://op-contracts/v1.7.0-beta.1+l2-contracts
global_log_level: "info"
global_node_selectors: {}
global_tolerations: []
Expand Down
36 changes: 34 additions & 2 deletions src/contracts/contract_deployer.star
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,36 @@ def deploy_contracts(
),
)

hardfork_schedule = []
for index, chain in enumerate(optimism_args.chains):
np = chain.network_params

# rename each hardfork to the name the override expects
renames = (
("l2GenesisFjordTimeOffset", np.fjord_time_offset),
("l2GenesisGraniteTimeOffset", np.granite_time_offset),
("l2GenesisHoloceneTimeOffset", np.holocene_time_offset),
("l2GenesisIsthmusTimeOffset", np.isthmus_time_offset),
("l2GenesisInteropTimeOffset", np.interop_time_offset),
)

# only include the hardforks that have been activated since
# toml does not support null values
for fork_key, activation_timestamp in renames:
if activation_timestamp != None:
hardfork_schedule.append((index, fork_key, activation_timestamp))

intent_updates = (
[
(
"string",
"contractArtifactsURL",
optimism_args.op_contract_deployer_params.artifacts_url,
"l1ContractsLocator",
optimism_args.op_contract_deployer_params.l1_artifacts_locator,
),
(
"string",
"l2ContractsLocator",
optimism_args.op_contract_deployer_params.l2_artifacts_locator,
),
]
+ [
Expand All @@ -64,6 +88,14 @@ def deploy_contracts(
)
for index, chain in enumerate(optimism_args.chains)
]
+ [
(
"string",
"chains.[{0}].deployOverrides.{1}".format(index, fork_key),
"0x%x" % activation_timestamp,
)
for index, fork_key, activation_timestamp in hardfork_schedule
]
)

op_deployer_configure = plan.run_sh(
Expand Down
16 changes: 12 additions & 4 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def input_parser(plan, input_args):
holocene_time_offset=result["network_params"][
"holocene_time_offset"
],
isthmus_time_offset=result["network_params"]["isthmus_time_offset"],
interop_time_offset=result["network_params"]["interop_time_offset"],
fund_dev_accounts=result["network_params"]["fund_dev_accounts"],
),
Expand All @@ -93,7 +94,12 @@ def input_parser(plan, input_args):
],
op_contract_deployer_params=struct(
image=results["op_contract_deployer_params"]["image"],
artifacts_url=results["op_contract_deployer_params"]["artifacts_url"],
l1_artifacts_locator=results["op_contract_deployer_params"][
"l1_artifacts_locator"
],
l2_artifacts_locator=results["op_contract_deployer_params"][
"l2_artifacts_locator"
],
),
global_log_level=results["global_log_level"],
global_node_selectors=results["global_node_selectors"],
Expand Down Expand Up @@ -208,8 +214,9 @@ def default_network_params():
"name": "op-kurtosis",
"seconds_per_slot": 2,
"fjord_time_offset": 0,
"granite_time_offset": None,
"granite_time_offset": 0,
"holocene_time_offset": None,
"isthmus_time_offset": None,
"interop_time_offset": None,
"fund_dev_accounts": True,
}
Expand Down Expand Up @@ -256,8 +263,9 @@ def default_participant():

def default_op_contract_deployer_params():
return {
"image": "mslipper/op-deployer:latest",
"artifacts_url": "https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-4accd01f0c35c26f24d2aa71aba898dd7e5085a2ce5daadc8a84b10caf113409.tar.gz",
"image": "us-docker.pkg.dev/oplabs-tools-artifacts/images/op-deployer:v0.0.6",
"l1_artifacts_locator": "tag://op-contracts/v1.6.0",
mslipper marked this conversation as resolved.
Show resolved Hide resolved
"l2_artifacts_locator": "tag://op-contracts/v1.7.0-beta.1+l2-contracts",
}


Expand Down
3 changes: 2 additions & 1 deletion src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ SUBCATEGORY_PARAMS = {

OP_CONTRACT_DEPLOYER_PARAMS = [
"image",
"artifacts_url",
"l1_artifacts_locator",
"l2_artifacts_locator",
]

ADDITIONAL_SERVICES_PARAMS = [
Expand Down