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

Espresso migration #46

Merged
merged 55 commits into from
Sep 10, 2024
Merged

Espresso migration #46

merged 55 commits into from
Sep 10, 2024

Conversation

zacshowa
Copy link
Member

@zacshowa zacshowa commented Aug 21, 2024

Closes # 162

TODO

  • Clean up script, add clear comments on what steps are doing what.
  • Explain which steps are really part of the Upgrade process and which are only to make the test work.
  • Add a README.md,
  • Verify staker is working, depends on Remove the global state for HotShot height nitro-espresso-integration#210
  • Do not use a docker image built from a Pull Request (i. e. merge changes we need into integration branch on our nitro fork)

This PR:

Is a draft for a PR that will include a full E2E migration test using the nitro test node.
Currently this PR:

  • starts a default nitro sequencer via the included tooling, including setting up a rollup.
  • starts an instance of the espresso-dev-node
  • shuts down the default nitro sequencer node
  • attempts to start the Espresso integrated nitro sequencer node in a new docker image using the same storage volumes, with a different config volume. (I'm thinking out loud at the time of writing this description. Maybe it makes more sense to do something different with the same volume instead of making a new volume. I was worried if the volume was still in use, I wouldn't be able to write to it.)

This PR does not:

Currently install the new contracts and attempt to perform the upgrade.

Key places to review:

the espresso integrated sequencer is currently not starting due to a lack of some required items in its config. I still need to track down and copy these over to the correct volume.

Run the script migration-test.bash

@@ -165,6 +165,23 @@ services:
depends_on:
- geth

espresso-sequencer:
pid: host # allow debugging
image: espresso-integration-testnode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between this and nitro-node-dev-testnode

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev:integration eventually but it's currently necessary to use a local docker image for testing because we haven't merged @zacshowa's E2E changes in nitro and they will be needed for this upgrade test. So I guess it's a locally tagged image.

scripts/config.ts Outdated Show resolved Hide resolved
docker-compose.yaml Outdated Show resolved Hide resolved
zacshowa and others added 2 commits August 27, 2024 23:16
- Add `--tokenbridge` to get an UpgradeExecutor on child chain. This
  allows us to execute the Actions on the child chain.
- Add pending check to verify staker is making progress.
- Decode return values from cast by specifying return type.
- Remove `--private-key` argument for cast calls.
- Simplify the check for updated balances.
@@ -0,0 +1,21 @@
# env vars for chain name and rpc_url
CHAIN_NAME="1337"
Copy link
Collaborator

@sveitser sveitser Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHAIND_ID, also we should prefix everything from L1 with L1, or PARENT_CHAIN.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think renaming everything to parent and child chain makes sense as L1 and L2 don't necessarily make sense in the context of orbit chains.

# Environment variables for chain name and rpc_url
# These are essential for the upgrade
PARENT_CHAIN_CHAIN_ID="1337"
CHILD_CHAIN_CHAIN_NAME="412346"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I there a reason to call this "name"? It's also the chain ID.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we can rename this. In my head chain name and chain id are interchangeable which is not the case for Arbitrum or Ethereum.


## Steps related to upgrade in production

Many of the steps in the test are nearly identical to the steps needed to upgrade an orbit network to be compatible with the espresso network.
Copy link
Collaborator

@sveitser sveitser Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the instructions on how to carry out the upgrade should go into a new README in orbit-actions, not this repo. They should also contain instructions to deploy and execute all the actions required for the Espresso upgrade.

Let's link to this test from the new README in orbit-actions for the curious.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and I'm actively working on a README in that repo.

test-node.bash Outdated
docker compose run scripts write-config --simple
echo == Writing configs for simple
docker compose run scripts write-config --simple --simpleWithValidator $simple_with_validator --espresso $l2_espresso --lightClientAddress $lightClientAddr
if $l2_espresso; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if this is necessary? The only difference is running a different docker container but scripts and scripts-espresso actually are the same? And I think we need to use scripts-espresso only in the migration test, not the test-node.bash?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think that this should be moved to the migration test bash script. I just remember this being a cleaner way to write a config to a different config volume than to write to two different locations in the javascript code. I believe it's probably better to write the configs to two different volumes as well. IMO overwriting the original config volume would be less clear to any future readers of the code.

scripts/index.ts Outdated
@@ -2,7 +2,7 @@ import { hideBin } from "yargs/helpers";
import Yargs from "yargs/yargs";
import { stressOptions } from "./stress";
import { redisReadCommand, redisInitCommand } from "./redis";
import { writeConfigCommand, writeGethGenesisCommand, writePrysmCommand, writeL2ChainConfigCommand, writeL3ChainConfigCommand } from "./config";
import { writeConfigCommand, writeGethGenesisCommand, writePrysmCommand, writeL2ChainConfigCommand, writeL3ChainConfigCommand} from "./config";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary changes

@@ -489,4 +531,4 @@ export const writeL3ChainConfigCommand = {
handler: (argv: any) => {
writeL3ChainConfig(argv)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is unnecessary, but I don't know what I would do to fix this part of the commit log. I had added and removed a function after this brace. However, I didn't actually modify it at all, so I'm not exactly sure why git is registering it as a changed line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using some formatter extension to remove the trailing new line?

@@ -3,5 +3,8 @@ WORKDIR /workspace
COPY ./package.json ./yarn.lock ./
RUN yarn
COPY ./*.ts ./tsconfig.json ./
RUN mkdir /config
# populate this file with valid json that will later be overwritten. If we don't do this the docker image won't build because of typescript looking for this file before the volume that contains it is mounted (I assume)
RUN cp ./tsconfig.json /config/l2_chain_info.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still an issue? A bit strange I think

@ImJeremyHe ImJeremyHe marked this pull request as ready for review September 9, 2024 03:25
@zacshowa zacshowa merged commit 7c64b09 into integration Sep 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants