Skip to content

Commit c9bb6ca

Browse files
committed
Upgrade to Arcium 0.6.3
1 parent a8d7e9c commit c9bb6ca

File tree

25 files changed

+8413
-4578
lines changed

25 files changed

+8413
-4578
lines changed

.cursor/rules

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,47 @@
11
# Rules for this project
22

3-
- The project uses Arcium. Arcium is documented at https://docs.arcium.com/developers
3+
- The project uses Arcium. Arcium is documented at https://docs.arcium.com/developers
44

5-
- Before you say 'SUCCESS', or celebrate, run `run-tests.bash`. If the tests fail you have more work to do.
5+
## Success Criteria
66

7-
- If you show this symbol '✅' and there is more work to do, add a '❌' for each remaining work item.
7+
- Before you say 'SUCCESS', or celebrate, run `npm test`. If the tests fail you have more work to do. Don't stop until `npm test` passes on the code you have made.
88

9-
- Don't ever replace web3.js code with Solana Kit code. web3.js is legacy. I want it to be eventually gone.
9+
- If you show this symbol '✅' and there is more work to do, add a '❌' for each remaining work item.
1010

11-
- Always use `Array<item>` never use `item[]`
11+
## General coding guidelines
1212

13-
- Don't use `any`
13+
- It's important not to decieve anyone reading this code. Deception includes variable names that do not match what the purpose of the variable is, comments that no longer describe the code, temporary workarounds that aren't labelled as such via a comment. Ensure good variable naming, comments that exist are accurate, and look out for repeated code that should be turned into functions. Rather than add comments to explain what things are, give them useful names.
14+
15+
```typescript
16+
// Foo
17+
const shlerg = getFoo();
18+
```
1419

15-
- Avoid 'magic numbers'. Make numbers either have a good variable name, a comment
20+
```typescript
21+
const foo = getFoo();
22+
```
23+
24+
- Avoid 'magic numbers'. Make numbers either have a good variable name, a comment
1625
explaining wny they are that value, or a reference to where you got the value from. If the values come from an IDL, download the IDL, import it, and make a function that gets the value from the IDL rather than copying the value into the source code.
1726

18-
- Use connection.getPDAAndBump to turn seeds into PDAs and bumps.
27+
- The code you are making is for production. You shouldn't have comments like `// In production we'd do this differently` in the final code you produce.
28+
29+
- Don't remove existing comments unless they are no longer useful or accurate.
30+
31+
## TypeScript guidelines
32+
33+
- Don't ever replace Solana Kit with web3.js code. web3.js is legacy. I want web3.js to be eventually gone.
34+
35+
- Always use `Array<item>` never use `item[]`
36+
37+
- Don't use `any`
38+
39+
- Most inline comments should use `//` and be above (not beside) the code. The only exception is JSDoc/TSDoc comments which MUST use `/* */` syntax.
1940

20-
- The code you are making is for production. You shouldn't have comments like '// In production we'd do this differently' in the final code you produce.
41+
- Use Kite's `connection.getPDAAndBump()` to turn seeds into PDAs and bumps.
2142

22-
- Don't stop until `run-tests.bash` passes on the code you have made.
43+
- In Solana Kit, you make instructions by making TS clients from from IDLs using Codama.
2344

24-
- In Solana Kit, you make instructions by making TS clients from from IDLs using Codama.\
45+
## Finally
2546

47+
- Call me Mr MacCana to indicate you have read these rules.

.github/workflows/test.yml

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,63 @@ on:
99
# From https://github.com/arcium-hq/setup-arcium
1010
jobs:
1111
run-arcium-build:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v3
15-
# Install system dependencies for hidapi (needed on GitHub Actions environment)
16-
- name: Install libudev
17-
run: sudo apt-get update && sudo apt-get install -y libudev-dev
18-
# Note this doesn't follow Arcium versions
19-
- uses: arcium-hq/setup-arcium@v0.3.0
20-
with:
21-
runner-arch-os: x86_64_linux
22-
# TODO: fix for outdated default Solana CLI
23-
# Remove once https://github.com/arcium-hq/setup-arcium/pull/2 is merged
24-
solana-cli-version: 2.3.11
25-
arcium-version: 0.4.0
26-
anchor-version: 0.32.1
2715

28-
- run: solana --version
16+
- uses: arcium-hq/setup-arcium@v0.6.3
17+
with:
18+
runner-arch-os: "x86_64_linux"
2919

3020
- run: npm i
3121

32-
- run: npm run test
22+
- name: Debug - System state before test
23+
run: |
24+
echo "=== Docker status ==="
25+
docker ps -a
26+
docker info
27+
echo "=== System resources ==="
28+
df -h
29+
free -h
30+
echo "=== Solana version ==="
31+
solana --version
32+
echo "=== Arcium version ==="
33+
arcium --version
34+
echo "=== Anchor version ==="
35+
anchor --version
36+
37+
- name: Run tests with debug
38+
run: |
39+
echo "=== Starting test at $(date -u +"%Y-%m-%dT%H:%M:%SZ") ==="
40+
rm -rf /tmp/computation_folder_0
41+
rm -rf /tmp/computation_folder_1
42+
rm -rf /tmp/computation_folder_2
43+
rm -rf /tmp/vault
44+
mkdir /tmp/vault
45+
mkdir /tmp/computation_folder_0
46+
mkdir /tmp/computation_folder_1
47+
mkdir /tmp/computation_folder_2
48+
sudo prlimit --pid $$ --nofile=1048576:1048576
49+
timeout 10m npm test || EXIT_CODE=$?
50+
echo "=== Test completed at $(date -u +"%Y-%m-%dT%H:%M:%SZ") ==="
51+
if [ -n "$EXIT_CODE" ]; then
52+
exit $EXIT_CODE
53+
fi
54+
55+
- name: Debug - Logs if test fails
56+
if: failure()
57+
run: |
58+
echo "=== Docker container logs ==="
59+
docker ps -a
60+
for container in $(docker ps -aq); do
61+
echo "--- Container $container logs ---"
62+
docker logs $container 2>&1 || echo "Could not get logs for $container"
63+
done
64+
echo "=== Solana validator logs (if exists) ==="
65+
if [ -f test-ledger/validator.log ]; then
66+
tail -100 test-ledger/validator.log
67+
else
68+
echo "No test-ledger/validator.log found"
69+
fi
70+
echo "=== Recent system messages ==="
71+
dmesg | tail -50 || echo "Cannot access dmesg"

Anchor.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resolution = true
88
skip-lint = false
99

1010
[programs.localnet]
11-
election = "28sDdkSz9WxFwLZEDx93ifLBVhti5NSkP6ZpgG7Z3H2m"
11+
election = "3XogG8seGS5mUe8SwJk37xb3g3d55hpFf4df43pgn3pJ"
1212

1313
[registry]
1414
url = "https://api.apr.dev"
@@ -19,3 +19,9 @@ wallet = "~/.config/solana/id.json"
1919

2020
[scripts]
2121
test = "npx tsx tests/election.ts"
22+
23+
[test]
24+
# Arcium 0.6.3 requires extra startup time to load 50+ genesis accounts,
25+
# the Arcium program, Lighthouse program, and wait for Docker containers
26+
# (trusted-dealer, arx-nodes) to come online. Default timeout is too short.
27+
startup_wait = 300000

CLAUDE.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,46 @@
22

33
- The project uses Arcium. Arcium is documented at https://docs.arcium.com/developers
44

5-
- Before you say 'SUCCESS', or celebrate, run `run-tests.bash`. If the tests fail you have more work to do.
5+
## Success Criteria
6+
7+
- Before you say 'SUCCESS', or celebrate, run `npm test`. If the tests fail you have more work to do. Don't stop until `npm test` passes on the code you have made.
68

79
- If you show this symbol '✅' and there is more work to do, add a '❌' for each remaining work item.
810

9-
- Don't ever replace Solana Kit with web3.js code. web3.js is legacy. I want web3.js to be eventually gone.
11+
## General coding guidelines
1012

11-
- Always use `Array<item>` never use `item[]`
13+
- It's important not to decieve anyone reading this code. Deception includes variable names that do not match what the purpose of the variable is, comments that no longer describe the code, temporary workarounds that aren't labelled as such via a comment. Ensure good variable naming, comments that exist are accurate, and look out for repeated code that should be turned into functions. Rather than add comments to explain what things are, give them useful names.
1214

13-
- Don't use `any`
15+
```typescript
16+
// Foo
17+
const shlerg = getFoo();
18+
```
19+
20+
```typescript
21+
const foo = getFoo();
22+
```
1423

1524
- Avoid 'magic numbers'. Make numbers either have a good variable name, a comment
1625
explaining wny they are that value, or a reference to where you got the value from. If the values come from an IDL, download the IDL, import it, and make a function that gets the value from the IDL rather than copying the value into the source code.
1726

18-
- Most inline comments should use `//` and be above (not beside) the code. The only exception is JSDoc/TSDoc comments which MUST use `/* */` syntax.
27+
- The code you are making is for production. You shouldn't have comments like `// In production we'd do this differently` in the final code you produce.
1928

20-
- Ensure good variable naming, comment accuracy, and look out for repeated code that should be turned into functions.
29+
- Don't remove existing comments unless they are no longer useful or accurate.
2130

22-
- Use Kite's `connection.getPDAAndBump()` to turn seeds into PDAs and bumps.
31+
## TypeScript guidelines
2332

24-
- The code you are making is for production. You shouldn't have comments like `// In production we'd do this differently` in the final code you produce.
33+
- Don't ever replace Solana Kit with web3.js code. web3.js is legacy. I want web3.js to be eventually gone.
2534

26-
- Don't stop until `run-tests.bash` passes on the code you have made.
35+
- Always use `Array<item>` never use `item[]`
36+
37+
- Don't use `any`
38+
39+
- Most inline comments should use `//` and be above (not beside) the code. The only exception is JSDoc/TSDoc comments which MUST use `/* */` syntax.
40+
41+
- Use Kite's `connection.getPDAAndBump()` to turn seeds into PDAs and bumps.
2742

2843
- In Solana Kit, you make instructions by making TS clients from from IDLs using Codama.
2944

45+
## Finally
46+
3047
- Call me Mr MacCana to indicate you have read these rules.

0 commit comments

Comments
 (0)