wormhole-foundation/native-token-transfers

solana: Document IDL repo policy, tools, and CI checks

Open

#443 opened on May 8, 2024

 (4 comments) (0 reactions) (0 assignees)TypeScript (97 forks)auto 404
documentationhelp wantedsolanatooling

Repository metrics

Stars
 (44 stars)
PR merge metrics
 (PR metrics pending)

Description

Issue

A PR I wrote is failing due to issues with the IDL generated by the new code and the code committed to the repo (I think)? https://github.com/wormhole-foundation/example-native-token-transfers/actions/runs/8943060910/job/24566966899?pr=298

In general I'm sort of lost regarding what parts of the build happens where.

Desired solution

  • Add some quick, grok-able steps for patching Solana code quickly.
  • Identify which parts of the process are covered by the various build tools (Makefile, Docker, bash scripts, GitHub CI workflows) and how to reproduce remote commands locally

Details/Pain Points

It's not obvious how to resolve this issue:

  • Running the command git diff --exit-code idl locally didn't work
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
  • There is no obvious target in the Makefile either in the top-level directory or the solana/ directory

  • Running the scripts in solana/scripts fails:

./scripts/patch-idl
./scripts/patch-idl: line 5: $1: unbound variable

./scripts/run-ts-tests
Patched ../target/idl/example_native_token_transfers.json
yarn run v1.22.22
$ solana/node_modules/.bin/ts-mocha -p ./tsconfig.json -t 1000000 'tests/**/*.ts'
secp256k1 unavailable, reverting to browser version
(node:77102) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)


  example-native-token-transfers
    1) "before all" hook for "Can check version"


  0 passing (43ms)
  1 failing

  1) example-native-token-transfers
       "before all" hook for "Can check version":
     TypeError: fetch failed
      at node:internal/deps/undici/undici:12502:13
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at ClientBrowser.callServer (node_modules/@solana/web3.js/src/connection.ts:1625:17)
  • docker build . did not yield helpful results:
[+] Building 0.5s (3/3) FINISHED                                                                                                                                                                                                                             docker:desktop-linux
=> [internal] load build definition from Dockerfile                                                                                                                                                                                                                         0.0s
=> => transferring dockerfile: 2.09kB                                                                                                                                                                                                                                       0.0s
=> ERROR [internal] load metadata for docker.io/library/solana-contract:latest                                                                                                                                                                                              0.4s
=> [internal] load metadata for docker.io/backpackapp/build:v0.29.0@sha256:9aee169b2d8b89b4a4243419ae35c176773136e78d751b3e439eff692c9c1293                                                                                                                                 0.4s
------
> [internal] load metadata for docker.io/library/solana-contract:latest:
------
Dockerfile:37
--------------------
 35 |     COPY --from=solana-contract /opt/solana/deps/nft_bridge.so /opt/solana/deps/nft_bridge.so
 36 |     COPY --from=solana-contract /opt/solana/deps/cpi_poster.so /opt/solana/deps/cpi_poster.so
 37 | >>> COPY --from=solana-contract /opt/solana/deps/mpl_token_metadata.so /opt/solana/deps/mpl_token_metadata.so
 38 |     COPY --from=solana-contract /opt/solana/deps/wormhole_migration.so /opt/solana/deps/wormhole_migration.so
 39 |
--------------------
ERROR: failed to solve: solana-contract: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/ykv6p646wgr65ko57ypmxw5s7

Contributor guide