-
Notifications
You must be signed in to change notification settings - Fork 58
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 minimal viable Anchor #602
Conversation
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
@@ -29,3 +29,27 @@ contract ArbitrumMockErc20GatewayRouter { | |||
return address(this); | |||
} | |||
} | |||
|
|||
contract Inbox { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interfaces added to replace the need for arb-bridge-eth
and arb-bridge-peripherals
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
@@ -66,8 +71,8 @@ | |||
"@types/node": "^12.0.0", | |||
"@typescript-eslint/eslint-plugin": "^4.29.1", | |||
"@typescript-eslint/parser": "^4.29.1", | |||
"arb-bridge-eth": "^0.7.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages removed to get node 20 support.
@@ -19,20 +19,25 @@ | |||
"main": "dist/index.js", | |||
"scripts": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note some of the extra split up scripts that I added so we can have seperate parts executed from CI job. We might want to further split up the build command.
Signed-off-by: chrismaree <[email protected]>
cache: "yarn" | ||
node-version: "${{ matrix.node }}" | ||
cache: yarn | ||
- name: Setup Anchor & Build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside: is github CI smart enough to only run certain tasks if certain files are changed? For example, we should only run anchor tasks if solana files are touched right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not easily. right now it will do all parts of the work flow on each run. we can improve this later. it's not too slow by comparison to how it was before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional runs are pretty hard, but I think there are easier ways to make it less imapctful.
Two things on this if it becomes a pain point:
- We can use a docker image with rust tools and/or solana tools preinstalled.
- We can run this setup in parallel while we're doing EVM build, tests, etc, which I suspect will take longer.
Signed-off-by: chrismaree <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just a few small questions around ci.
I also ran the install and svm-test locally. All worked great.
cache: "yarn" | ||
node-version: "${{ matrix.node }}" | ||
cache: yarn | ||
- name: Setup Anchor & Build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional runs are pretty hard, but I think there are easier ways to make it less imapctful.
Two things on this if it becomes a pain point:
- We can use a docker image with rust tools and/or solana tools preinstalled.
- We can run this setup in parallel while we're doing EVM build, tests, etc, which I suspect will take longer.
.github/workflows/pr.yml
Outdated
run: solana-keygen new --no-bip39-passphrase | ||
shell: bash | ||
- name: Make Anchor.toml compatible with runner | ||
run: "sed -i 's:/user/:/runner/:' Anchor.toml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the string user
in the Anchor.toml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might actually be able to delete this. it was trying to get anchor to detect the solana-keygen new
command from above. the util can in some environments place the key in a location anchor cant find it, hence this command. but it looks like we don't need that after all and the tests run without it.
@@ -24,6 +24,13 @@ jobs: | |||
uses: manovotny/[email protected] | |||
|
|||
# Setup .npmrc file to publish to npm | |||
- name: Setup Anchor & Build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move the comment above down to above npm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, sorry. I messed that up. have fixed it.
.github/workflows/pr.yml
Outdated
with: | ||
anchor-version: 0.30.1 | ||
solana-cli-version: 1.18.21 | ||
node-version: 20.17.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this break if the node version varies (i.e. 20 resolves to 20.17.1)?
Can we just specify 20 here or does it have to be specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will work just fine? the version specified above in the config has 20
set, with no sub versions. I'll try changing this here and see if the workflow still runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test worked just fine with the node version simply being "20"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect
@@ -468,6 +468,9 @@ const config: HardhatUserConfig = { | |||
outDir: "./typechain", | |||
target: "ethers-v5", | |||
}, | |||
paths: { | |||
tests: "./test/evm/hardhat", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've double checked that this still runs all the tests, right? Just want to double check that a change like this doesn't accidentally disable all the evm tests because of a minor typo or config issue causes it to point at an empty dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR re-works this repo to work alongside Solana Anchor. To achieve this, it adds a number of dependencies and re-works a lot of the repo layout, such as moving where some tests are located (hence the large file diff). In broad strokes this PR does:
arb-bridge-eth
andarb-bridge-peripherals
. both of these are not supported by Arbitrum anymore. We only used these packages to fetch the interfaces in some tests when creating a fake. to supplement this, theArbutrumMocks.sol
was updated to store the same interface (see here).Anchor.toml, Cargo.lock, Cargo.toml, Programs/x, test/svm/x
. sample program has the simplest posible SVM contract and test to show the tooling working./test/x
to/test/evm/hardhat
&/test/evm/foundry
to better separate test directories and not mix and match the way things were before. This required editing all ts files within the test directory, hence the large change in the PR (done with an automated tool).