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

Add Optimism Bedrock #901

Merged
merged 7 commits into from
Jul 11, 2024
Merged

Conversation

kaladinlight
Copy link
Contributor

@kaladinlight kaladinlight commented Mar 24, 2023

  • Optimism support for bedrock upgrade
  • Closing Add Optimism #868 in favor of this PR and considering upgrade should be coming up within the next month
    • removes local node dependencies for building the data-transport-layer
    • removes alchemy L2 rpc url dependency

Blockbook:
image

Etherscan:
image

@kaladinlight kaladinlight changed the title Add optimism bedrock Add Optimism Bedrock Mar 24, 2023
docs/ports.md Outdated Show resolved Hide resolved
docs/ports.md Outdated Show resolved Hide resolved
@kaladinlight kaladinlight marked this pull request as draft March 24, 2023 21:46
@kaladinlight kaladinlight mentioned this pull request Mar 24, 2023
@kaladinlight kaladinlight force-pushed the add-optimism-bedrock branch 2 times, most recently from 3a7a36e to 728739d Compare June 7, 2023 16:53
@kaladinlight kaladinlight marked this pull request as ready for review June 7, 2023 17:18
@kaladinlight
Copy link
Contributor Author

@martinboehm ready for review, successful bedrock upgrade on my end and blockbook still working as expected

@kaladinlight
Copy link
Contributor Author

@martinboehm if you have any time at some point, would we be able to upstream optimism (bedrock)? I have been running the blockbook for the past 6 months or so without any issues. I am not using the infra, so that could use some 👀 to make sure everything is working as expected. Let me know if you have time or any thoughts. Thank you!

@kaladinlight kaladinlight force-pushed the add-optimism-bedrock branch 4 times, most recently from 230c9c9 to ac4fb9d Compare May 7, 2024 20:34
@kaladinlight
Copy link
Contributor Author

@martinboehm ok, pushed some updates for the backend. note I haven't ever actually run the archive setup fully, but feel free to test it and happy to help debug any issues

@martinboehm
Copy link
Contributor

@kaladinlight Blockbook runs well. Just be aware of this commit 35ab7a3. Maybe it would be a good idea to backport it to this PR.

I successfully built backend-optimism-archive-op-node.service. However when I started it, it exited with this report:

/bin/sh: 1: Syntax error: redirection unexpected
backend-optimism-archive-op-node.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

After I modified the redirection to 2>&1 >> and tried again, I got the following error:

/bin/sh: 1: /opt/coins/nodes/optimism_archive_op_node/op-node: not found

I realized that you are doing the build as a post install step. However, there is no go environment on the server. Could you please move the build step to the extract_command in a similar way it is done for example in configs/coins/polygon_heimdall.json.

@kaladinlight
Copy link
Contributor Author

@martinboehm Hey, just got back from travel. Happy to hear blockbook is running well. I will go ahead and backport that commit and take a closer look at the backend config to sort those issues and give you a ping.

@kaladinlight
Copy link
Contributor Author

kaladinlight commented Jun 12, 2024

@martinboehm I backported the eth.OpenRPC change and updated the op-node config to build during the extract stage and updated the redirect syntax. I ran things locally (manual exec command vs service setup due to my env) and things were where they should be and started as expected. I did not have all local services (optimism/legacy geth) to fully initialize and start syncing, just verified it was running and trying to connect to things. Let me know if that fixes the issues on your side!

@martinboehm
Copy link
Contributor

@kaladinlight Thank you, the reported issues are fixed. However, run into another. The op-node is not starting, with this error:

failed to setup: unable to create the rollup node config: failed to load p2p config: failed to load p2p priv key: failed to store new p2p priv key: open opnode_p2p_priv.txt: permission denied

It is probably tryinig to store the opnode_p2p_priv.txt somewhere where it does not have permissions. It should store all files to the /opt/coins/data/optimism_archive_op_node/backend folder or subfolders, if possible.

@kaladinlight
Copy link
Contributor Author

@martinboehm There doesn't look to be any directory flag for the op_node local files. I just updated the exec command to run from the backend dir to ensure those files are created and stored there as expected.

@martinboehm
Copy link
Contributor

@kaladinlight Thank you, unfortunately I get backend-optimism-archive-op-node.service: Failed to locate executable cd: No such file or directory 🤦‍♂️

@kaladinlight
Copy link
Contributor Author

@martinboehm bleh... will take a look at a different strategy.

@kaladinlight
Copy link
Contributor Author

kaladinlight commented Jun 25, 2024

@martinboehm ok, I took another look and did find some path flags for these files, they were just nested under p2p unlike the typical singular dir or datadir setup. will be updating to use those and then things should be sorted finally. thanks for your patience

@kaladinlight
Copy link
Contributor Author

@martinboehm Ok, pushed those updates. Hopefully the last thing. Let me know if everything is working as expected now, thanks!

@martinboehm
Copy link
Contributor

@kaladinlight you are amazing, thank you 👍 op-node is starting now. Now I tried to build backend-optimism-archive and there is the same problem - the go build is post step instead of in build step. Could you please change it too?

@kaladinlight
Copy link
Contributor Author

kaladinlight commented Jun 26, 2024

@martinboehm so close! moved the go build into the extract command. I kept the openssl command in the postinst script as I would think that should included by default on any host system (can change if you would like, lemme know).

@martinboehm
Copy link
Contributor

Hmm, build was without problem, however on start I get

Resolving datadirs.optimism.io (datadirs.optimism.io)... 162.19.233.77
Connecting to datadirs.optimism.io (datadirs.optimism.io)|162.19.233.77|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://datadirs.optimism.io/latest/ [following]
--2024-07-01 21:51:35--  https://datadirs.optimism.io/latest/
Reusing existing connection to datadirs.optimism.io:443.
HTTP request sent, awaiting response... 200 OK
Length: 129 [text/html]
Saving to: <E2><80><98>STDOUT<E2><80><99>

     0K                                                       100%  424M=0s

2024-07-01 21:51:35 (424 MB/s) - written to stdout [129/129]

zstd: /*stdin*\: unsupported format
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

It is because wget https://datadirs.optimism.io/latest is not returning the zst file but instead a small file containing

<html><head><meta http-equiv="refresh" content="0; url=https://datadirs.optimism.io/mainnet-2024-06-08.tar.zst" /></head></html>

@kaladinlight
Copy link
Contributor Author

@martinboehm can you give it another try with this update f0729e2

@martinboehm
Copy link
Contributor

It looks good now 👍

@martinboehm
Copy link
Contributor

@kaladinlight I have probably the last request/question. I would prefer OP to be the shortcut for Optimism instead of "shortcut": "ETH"

@kaladinlight
Copy link
Contributor Author

kaladinlight commented Jul 1, 2024

@kaladinlight I have probably the last request/question. I would prefer OP to be the shortcut for Optimism instead of "shortcut": "ETH"

The shortcut is used for the native asset symbol which is accurately ETH on optimism as you can also see on the etherscan clone. OP is their native token, but not the native gas asset.

image

@kaladinlight
Copy link
Contributor Author

@martinboehm just making sure you have seen the above comment since I didn't @ you directly. Let me know if that makes sense, or if you have any questions there. Looking forward to getting this in!

@blackbird-sarodh
Copy link

qq: will this chain type be compatible with Base Layer 2? Sorry if not relevant. Thanks!

@kaladinlight
Copy link
Contributor Author

qq: will this chain type be compatible with Base Layer 2? Sorry if not relevant. Thanks!

This specific PR only supports optimism, but I do have base support working and coming next based off this. Stay tuned!

@martinboehm martinboehm merged commit 4b9a0a9 into trezor:master Jul 11, 2024
@martinboehm
Copy link
Contributor

@kaladinlight Thank you!!

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