-
Notifications
You must be signed in to change notification settings - Fork 15
Initial tuktuk buildout #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
7d79e7a
Initial tuktuk buildout
ChewingGlass b5b7c4e
Add ability to close queue and min deposit requirements
ChewingGlass bda41be
Bugfix
ChewingGlass 7dedf58
Add guards against spending too much
ChewingGlass a43c56a
Fix tests
ChewingGlass 882214b
fix tests
ChewingGlass 28cd8eb
fix writable
ChewingGlass 7208586
Attempting to work through CPI rescheduling
ChewingGlass 8237557
almost working
ChewingGlass b18d6a0
Implement self-rescheduling
ChewingGlass 7631a98
Add docker support
ChewingGlass 3c681d6
Switch to entirely sol based
ChewingGlass 20dc97e
WIP: Add remote transactions
ChewingGlass bc0fc4f
Add a remote server example and tested it works
ChewingGlass 2a7edaf
Cron jobs working, needs cli support
ChewingGlass 5d7ef94
Add cli support for crons, closing tasks
ChewingGlass ad0c456
Fix build
ChewingGlass 63f40fc
Fix build
ChewingGlass 8691cf1
Readme, more lint
ChewingGlass c5e2b3f
More lint
ChewingGlass 575a799
Set rust toolchain
ChewingGlass 79671fb
Add rustfmnt clipptt
ChewingGlass f4aa9de
Add cron tests to github actions
ChewingGlass b65b57f
Fix account watching logic
ChewingGlass 8c263bb
Add ability to queue tasks from a return account for large crons
ChewingGlass 19eaa5f
Add LUTs, reduce TX size for remote txs
ChewingGlass 6b36413
Use an anchor account for RemoteTaskTransactionV0 so that it can be p…
ChewingGlass cd332cd
Lint
ChewingGlass 2c8076b
Fix builds
ChewingGlass 8d71496
Fix tx packing and requeue
ChewingGlass 1fb3ee9
Add new signer type
ChewingGlass cb793af
Add docker info
ChewingGlass 5c154c6
Fix envs
ChewingGlass 82ca61c
Rm unused
ChewingGlass e881cb0
Code review comments
ChewingGlass 7ba2b80
Fix payouts
ChewingGlass b8d7307
Add metrics
ChewingGlass 4dda8f9
Bugfixes with metrics
ChewingGlass 07f3709
lots of versionedtx bugs
ChewingGlass ae8a199
Missing metric
ChewingGlass ff4b5a9
Missing completion condition
ChewingGlass 98384b6
Fix never freeing up task ids
ChewingGlass 35355b9
Fix cron running a cycle too late
ChewingGlass 5688927
Some minor bugfixes and better metrics
ChewingGlass 87ac4da
Add descriptions to tasks
ChewingGlass 1b2384c
Add ability to have multiple queue authority
ChewingGlass 4e3b4f7
Bump ver
ChewingGlass 55f8ff9
Fix artifact
ChewingGlass 7a0f1b9
Add devnet feature
ChewingGlass 6097ff6
Trigger deploy
ChewingGlass ff20954
Fix develop change program
ChewingGlass 73dcfa8
Fix action
ChewingGlass 58cfb28
ignore cpi example
ChewingGlass b70cda0
Add missing lockfiles
ChewingGlass ddf549d
Fix cargo build verified
ChewingGlass 698599d
More fixes to deploy process
ChewingGlass 2e70217
Trigger build
ChewingGlass 2d52ca3
Fix broken action
ChewingGlass 95cb931
Fix action again
ChewingGlass a144eb5
More action fixing
ChewingGlass e611f44
ugggh
ChewingGlass 0832559
d
ChewingGlass 735f644
Rm IDL log
ChewingGlass b01ce35
Fix idl buffer save
ChewingGlass c08b52e
Bump sqds
ChewingGlass b480f38
Bugfixes
ChewingGlass fa29111
More bugfixes
ChewingGlass a61e159
README update
ChewingGlass 92c5416
Fix tests
ChewingGlass 23a903e
Fix tests
ChewingGlass File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| name: "Upload BPF" | ||
| description: "Uploads an anchor program as a bpf" | ||
| inputs: | ||
| devnet: | ||
| description: "Whether to use devnet feature" | ||
| required: false | ||
| default: "false" | ||
| testing: | ||
| description: "Whether to use devnet feature" | ||
| required: false | ||
| default: "false" | ||
| network: | ||
| description: "The Solana network" | ||
| required: true | ||
| default: "devnet" | ||
| program: | ||
| description: "The program to build and upload" | ||
| required: true | ||
| program-id: | ||
| description: "The program id of the program we are uploading" | ||
| required: true | ||
| keypair: | ||
| description: "The keypair to use for deploys" | ||
| required: true | ||
| buffer-authority: | ||
| description: "The buffer authority to set" | ||
| required: true | ||
| outputs: | ||
| buffer: | ||
| description: "The buffer address" | ||
| value: ${{ steps.buffer-deploy-store.outputs.BUFFER }} | ||
| idl-buffer: | ||
| description: "The idl buffer address." | ||
| value: ${{ steps.buffer-deploy-store.outputs.IDL_BUFFER }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: ./.github/actions/setup/ | ||
| - uses: ./.github/actions/setup-anchor/ | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| - run: echo "$DEPLOY_KEYPAIR" > ./deploy-keypair.json && chmod 600 ./deploy-keypair.json | ||
| shell: bash | ||
| env: | ||
| DEPLOY_KEYPAIR: ${{ inputs.keypair }} | ||
| working-directory: solana-programs | ||
| - run: solana-keygen new -s -o keyp --no-bip39-passphrase | ||
| working-directory: solana-programs | ||
| shell: bash | ||
| - run: ls -l ./target/deploy/ | ||
| shell: bash | ||
| working-directory: solana-programs | ||
| - name: Buffer Deploy | ||
| if: steps.cache-buffer.outputs.cache-hit != 'true' | ||
| id: buffer-deploy | ||
| uses: nick-invision/retry@v2 | ||
| with: | ||
| timeout_minutes: 30 | ||
| max_attempts: 10 | ||
| shell: bash | ||
| command: cd solana-programs && solana program write-buffer --max-sign-attempts 50 --with-compute-unit-price 100000 --use-rpc --buffer ./keyp -k ./deploy-keypair.json ./target/deploy/$PROGRAM.so -u $NETWORK > ./buffer.out | ||
| env: | ||
| NETWORK: ${{ inputs.network }} | ||
| PROGRAM: ${{ inputs.program }} | ||
| - name: IDL Buffer Deploy | ||
| uses: nick-invision/retry@v2 | ||
| id: idl-buffer-deploy | ||
| if: steps.cache-buffer.outputs.cache-hit != 'true' | ||
| with: | ||
| timeout_minutes: 10 | ||
| max_attempts: 50 | ||
| shell: bash | ||
| command: cd solana-programs && ~/.cargo/bin/anchor idl write-buffer $PROGRAM_ID --filepath ./target/idl/$PROGRAM.json --provider.cluster $NETWORK --provider.wallet ./deploy-keypair.json > idl-buffer.out | ||
| env: | ||
| PROGRAM_ID: ${{ inputs.program-id }} | ||
| PROGRAM: ${{ inputs.program }} | ||
| NETWORK: ${{ inputs.network }} | ||
| - name: Buffer Deploy Store | ||
| shell: bash | ||
| working-directory: solana-programs | ||
| id: buffer-deploy-store | ||
| run: | | ||
| echo "BUFFER=$(cat buffer.out | sed 's/Buffer: //g' | xargs echo -n)" >> $GITHUB_OUTPUT | ||
| echo "IDL_BUFFER=$(tail -n 1 idl-buffer.out | sed 's/Idl buffer created: //g' | xargs echo -n)" >> $GITHUB_OUTPUT | ||
| - run: echo "The buffer is ${{ steps.buffer-deploy-store.outputs.BUFFER }}" | ||
| shell: bash | ||
| working-directory: solana-programs | ||
| - run: echo "the idl buffer is ${{ steps.buffer-deploy-store.outputs.IDL_BUFFER }}" | ||
| shell: bash | ||
| working-directory: solana-programs | ||
| - name: Transfer idl buffer to authority | ||
| uses: nick-invision/retry@v2 | ||
| if: steps.cache-buffer.outputs.cache-hit != 'true' | ||
| with: | ||
| timeout_minutes: 10 | ||
| max_attempts: 50 | ||
| shell: bash | ||
| command: cd solana-programs && anchor idl set-authority $IDL_BUFFER --provider.cluster $NETWORK --program-id $PROGRAM_ID --new-authority $AUTHORITY --provider.wallet ./deploy-keypair.json | ||
| env: | ||
| IDL_BUFFER: ${{ steps.buffer-deploy-store.outputs.IDL_BUFFER }} | ||
| AUTHORITY: ${{ inputs.buffer-authority }} | ||
| NETWORK: ${{ inputs.network }} | ||
| PROGRAM_ID: ${{ inputs.program-id }} | ||
| - name: Transfer buffer to authority | ||
| uses: nick-invision/retry@v2 | ||
| if: steps.cache-buffer.outputs.cache-hit != 'true' | ||
| with: | ||
| timeout_minutes: 10 | ||
| max_attempts: 50 | ||
| shell: bash | ||
| command: cd solana-programs && solana program set-buffer-authority $BUFFER -k ./deploy-keypair.json --new-buffer-authority $AUTHORITY -u $NETWORK | ||
| env: | ||
| BUFFER: ${{ steps.buffer-deploy-store.outputs.BUFFER }} | ||
| AUTHORITY: ${{ inputs.buffer-authority }} | ||
| NETWORK: ${{ inputs.network }} | ||
| - run: rm ./deploy-keypair.json | ||
| shell: bash | ||
| if: always() | ||
| working-directory: solana-programs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: "Setup Anchor" | ||
| description: "Setup Anchor" | ||
| inputs: | ||
| devnet: | ||
| description: "Whether to use devnet feature" | ||
| required: false | ||
| default: "false" | ||
| testing: | ||
| description: "Whether to use devnet feature" | ||
| required: false | ||
| default: "false" | ||
| program: | ||
| description: "The program to build" | ||
| required: false | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: ./.github/actions/setup/ | ||
| - uses: ./.github/actions/setup-anchor/ | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| - uses: actions/cache@v2 | ||
| name: Cache Cargo registry + index | ||
| id: cache-cargo-registry | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/ | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| key: cargo-${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | ||
| - name: Cache Anchor Build | ||
| uses: actions/cache@v2 | ||
| id: cache-anchor-build | ||
| with: | ||
| path: | | ||
| ./solana-programs/target/ | ||
| key: build-${{ runner.os }}-${{env.ANCHOR_VERSION}}-${{env.ANCHOR_SHA}}-v0003-${{ inputs.devnet }}-${{ inputs.testing }}-${{ hashFiles('./solana-programs/programs/**/**') }}-${{ inputs.program }} | ||
| - run: ${{ inputs.testing == 'true' && 'TESTING=true' || '' }} ~/.cargo/bin/anchor build ${{ (inputs.program != '' && '-p') || '' }} ${{ inputs.program || '' }} ${{ inputs.devnet == 'true' && '-- --features devnet' || '' }} | ||
| if: steps.cache-anchor-build.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| working-directory: solana-programs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: "Build Verified" | ||
| description: "Builds an Anchor Program using solana-verify" | ||
| inputs: | ||
| devnet: | ||
| description: "Whether to use devnet feature" | ||
| required: false | ||
| default: "false" | ||
| testing: | ||
| description: "Whether to use devnet feature" | ||
| required: false | ||
| default: "false" | ||
| program: | ||
| description: "The program to build and upload" | ||
| required: true | ||
| program-id: | ||
| description: "The program id of the program we are uploading" | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: ./.github/actions/setup/ | ||
| - uses: ./.github/actions/setup-anchor/ | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| - uses: actions/cache@v2 | ||
| name: Cache Cargo registry + index | ||
| id: cache-cargo-registry | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| key: cargo-${{ runner.os }}-v0001-${{ hashFiles('**/Cargo.lock') }} | ||
| - uses: actions/cache@v2 | ||
| name: Cache Solana Verify | ||
| id: cache-solana-verify | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/solana-verify | ||
| key: cargo-${{ runner.os }}-solana-verify | ||
| - run: cargo install solana-verify --locked | ||
| if: steps.cache-solana-verify.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| - run: ${{ inputs.testing == 'true' && 'TESTING=true' || '' }} ~/.cargo/bin/solana-verify build --library-name $PROGRAM ${{ inputs.devnet == 'true' && '-- --features devnet' || '' }} | ||
| shell: bash | ||
| working-directory: solana-programs | ||
| env: | ||
| PROGRAM: ${{ inputs.program }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: "Setup Anchor" | ||
| description: "Setup Anchor" | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: ./.github/actions/setup/ | ||
| - uses: ./.github/actions/setup-solana/ | ||
| - uses: actions/cache@v2 | ||
| name: Cache Anchor Cli | ||
| id: cache-anchor-cli | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/anchor | ||
| key: anchor-cli-${{ runner.os }}-v0003-${{ env.ANCHOR_VERSION }}-${{ env.ANCHOR_SHA }} | ||
| # if ANCHOR_VERSION is 0, then install the anchor-cli from source | ||
| - run: if [ $ANCHOR_VERSION -eq 0 ]; then cargo install --git https://github.com/coral-xyz/anchor --rev $ANCHOR_SHA anchor-cli --locked --force; else cargo install --git https://github.com/coral-xyz/anchor --tag "v$ANCHOR_VERSION" anchor-cli --locked; fi | ||
| shell: bash | ||
| if: steps.cache-anchor-cli.outputs.cache-hit != 'true' | ||
| - uses: actions/cache@v2 | ||
| name: Cache Toml Cli | ||
| id: cache-toml-cli | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/toml | ||
| key: toml-cli-${{ runner.os }}-v0002 | ||
| - run: (cargo install toml-cli || true) | ||
| if: steps.cache-toml-cli.outputs.cache-hit != 'true' | ||
| shell: bash | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: "Setup Solana" | ||
| description: "Setup Solana" | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/cache@v2 | ||
| name: Cache Solana Tool Suite | ||
| id: cache-solana | ||
| with: | ||
| path: | | ||
| ~/.cache/solana/ | ||
| ~/.local/share/solana/ | ||
| key: solana-${{ runner.os }}-v0000-${{ env.SOLANA_CLI_VERSION }} | ||
| - run: sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_CLI_VERSION }}/install)" | ||
| shell: bash | ||
| if: steps.cache-solana.outputs.cache-hit != 'true' | ||
| - run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | ||
| shell: bash | ||
| - run: solana-keygen new -s --no-bip39-passphrase --force | ||
| shell: bash | ||
| - run: solana config set --url localhost | ||
| shell: bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: "Setup ts" | ||
| description: "Setup ts" | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| - uses: actions/cache@v2 | ||
| name: Cache Typescript node_modules | ||
| id: cache-typescript-node-modules | ||
| with: | ||
| path: | | ||
| ./solana-programs/node_modules/ | ||
| key: node-modules-${{ runner.os }}-v0000-${{ env.NODE_VERSION }}-${{ hashFiles('./yarn.lock') }}-${{ hashFiles('./**/*/package.json') }} | ||
| - run: corepack enable | ||
| shell: bash | ||
| working-directory: solana-programs | ||
| - run: yarn | ||
| shell: bash | ||
| working-directory: solana-programs | ||
| if: steps.cache-typescript-node-modules.outputs.cache-hit != 'true' | ||
| - run: yarn run build | ||
| shell: bash | ||
| working-directory: solana-programs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: "Setup" | ||
| description: "Setup" | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - run: sudo apt-get update | ||
| shell: bash | ||
| - run: sudo apt-get install -y pkg-config build-essential libudev-dev | ||
| shell: bash | ||
| - run: echo "ANCHOR_VERSION=0" >> $GITHUB_ENV | ||
| shell: bash | ||
| - run: echo "ANCHOR_SHA=98396c0aeffb4745ab08fb9f45e0d31ad0bd1402" >> $GITHUB_ENV | ||
| shell: bash | ||
| - run: git submodule update --init --recursive --depth 1 | ||
| shell: bash | ||
| - name: Install Protoc | ||
| uses: arduino/setup-protoc@v3 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: 1.80.1 | ||
| - uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.rustup/toolchains | ||
| ~/.rustup/update-hashes | ||
| ~/.rustup/settings.toml | ||
| key: rust-components-${{ runner.os }}-${{ hashFiles('**/rust-toolchain', '**/rust-toolchain.toml') }} | ||
| - run: rustup component add rustfmt | ||
| shell: bash | ||
| - run: rustup component add clippy | ||
| shell: bash |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 sure if you'll need it but
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 needed since we're on newer anchor I think