-
Notifications
You must be signed in to change notification settings - Fork 90
fix: prevent compressible account funding with 1 epoch #1993
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
Changes from all commits
0751037
e582def
ac90405
2ebd7fd
9de117a
0d90839
57e0a7b
734b1f1
fa6520a
8a3db21
32f66d8
165f5d4
58dca7f
918cccf
5e0e782
a0c9ae0
e6b333c
0eac1b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,120 @@ | ||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||
| - "programs/**" | ||||||||||||||||||||||||||||||||
| - "program-tests/**" | ||||||||||||||||||||||||||||||||
| - "program-libs/**" | ||||||||||||||||||||||||||||||||
| - "prover/client/**" | ||||||||||||||||||||||||||||||||
| - ".github/workflows/light-system-programs-tests.yml" | ||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||
| - "*" | ||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||
| - "programs/**" | ||||||||||||||||||||||||||||||||
| - "program-tests/**" | ||||||||||||||||||||||||||||||||
| - "program-libs/**" | ||||||||||||||||||||||||||||||||
| - "prover/client/**" | ||||||||||||||||||||||||||||||||
| - ".github/workflows/light-system-programs-tests.yml" | ||||||||||||||||||||||||||||||||
| types: | ||||||||||||||||||||||||||||||||
| - opened | ||||||||||||||||||||||||||||||||
| - synchronize | ||||||||||||||||||||||||||||||||
| - reopened | ||||||||||||||||||||||||||||||||
| - ready_for_review | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| name: programs | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| system-programs: | ||||||||||||||||||||||||||||||||
| name: programs | ||||||||||||||||||||||||||||||||
| if: github.event.pull_request.draft == false | ||||||||||||||||||||||||||||||||
| runs-on: warp-ubuntu-latest-x64-4x | ||||||||||||||||||||||||||||||||
| timeout-minutes: 90 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||||||||||
| redis: | ||||||||||||||||||||||||||||||||
| image: redis:8.0.1 | ||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||
| - 6379:6379 | ||||||||||||||||||||||||||||||||
| options: >- | ||||||||||||||||||||||||||||||||
| --health-cmd "redis-cli ping" | ||||||||||||||||||||||||||||||||
| --health-interval 10s | ||||||||||||||||||||||||||||||||
| --health-timeout 5s | ||||||||||||||||||||||||||||||||
| --health-retries 5 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||
| REDIS_URL: redis://localhost:6379 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||
| include: | ||||||||||||||||||||||||||||||||
| - program: account-compression-and-registry | ||||||||||||||||||||||||||||||||
| sub-tests: '["cargo-test-sbf -p account-compression-test", "cargo-test-sbf -p registry-test"]' | ||||||||||||||||||||||||||||||||
| - program: light-system-program-address | ||||||||||||||||||||||||||||||||
| sub-tests: '["cargo-test-sbf -p system-test -- test_with_address", "cargo-test-sbf -p e2e-test", "cargo-test-sbf -p compressed-token-test --test ctoken"]' | ||||||||||||||||||||||||||||||||
| - program: light-system-program-compression | ||||||||||||||||||||||||||||||||
| sub-tests: '["cargo-test-sbf -p system-test -- test_with_compression", "cargo-test-sbf -p system-test --test test_re_init_cpi_account"]' | ||||||||||||||||||||||||||||||||
| - program: compressed-token-and-e2e | ||||||||||||||||||||||||||||||||
| sub-tests: '["cargo-test-sbf -p compressed-token-test --test v1", "cargo-test-sbf -p compressed-token-test --test mint"]' | ||||||||||||||||||||||||||||||||
| - program: compressed-token-batched-tree | ||||||||||||||||||||||||||||||||
| sub-tests: '["cargo-test-sbf -p compressed-token-test -- test_transfer_with_photon_and_batched_tree"]' | ||||||||||||||||||||||||||||||||
| - program: system-cpi-test | ||||||||||||||||||||||||||||||||
| sub-tests: | ||||||||||||||||||||||||||||||||
| '["cargo-test-sbf -p system-cpi-test", "cargo test -p light-system-program-pinocchio", | ||||||||||||||||||||||||||||||||
| "cargo-test-sbf -p system-cpi-v2-test -- --skip functional_ --skip event::parse", "cargo-test-sbf -p system-cpi-v2-test -- event::parse", | ||||||||||||||||||||||||||||||||
| "cargo-test-sbf -p compressed-token-test --test transfer2" | ||||||||||||||||||||||||||||||||
| ]' | ||||||||||||||||||||||||||||||||
| - program: system-cpi-test-v2-functional-read-only | ||||||||||||||||||||||||||||||||
| sub-tests: '["cargo-test-sbf -p system-cpi-v2-test -- functional_read_only"]' | ||||||||||||||||||||||||||||||||
| - program: system-cpi-test-v2-functional-account-infos | ||||||||||||||||||||||||||||||||
| sub-tests: '["cargo-test-sbf -p system-cpi-v2-test -- functional_account_infos"]' | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
|
Comment on lines
+33
to
+76
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allow push workflows to run.
- if: github.event.pull_request.draft == false
+ if: github.event_name != 'pull_request' || github.event.pull_request.draft == false🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| - name: Checkout sources | ||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Setup and build | ||||||||||||||||||||||||||||||||
| uses: ./.github/actions/setup-and-build | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| skip-components: "redis,disk-cleanup" | ||||||||||||||||||||||||||||||||
| cache-key: "rust" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||
| - name: Build CLI | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| npx nx build @lightprotocol/zk-compression-cli | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: ${{ matrix.program }} | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| IFS=',' read -r -a sub_tests <<< "${{ join(fromJSON(matrix['sub-tests']), ', ') }}" | ||||||||||||||||||||||||||||||||
| for subtest in "${sub_tests[@]}" | ||||||||||||||||||||||||||||||||
| do | ||||||||||||||||||||||||||||||||
| echo "$subtest" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # Retry logic for flaky batched-tree test | ||||||||||||||||||||||||||||||||
| if [[ "$subtest" == *"test_transfer_with_photon_and_batched_tree"* ]]; then | ||||||||||||||||||||||||||||||||
| echo "Running flaky test with retry logic (max 3 attempts)..." | ||||||||||||||||||||||||||||||||
| attempt=1 | ||||||||||||||||||||||||||||||||
| max_attempts=3 | ||||||||||||||||||||||||||||||||
| until RUSTFLAGS="-D warnings" eval "$subtest"; do | ||||||||||||||||||||||||||||||||
| attempt=$((attempt + 1)) | ||||||||||||||||||||||||||||||||
| if [ $attempt -gt $max_attempts ]; then | ||||||||||||||||||||||||||||||||
| echo "Test failed after $max_attempts attempts" | ||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| echo "Attempt $attempt/$max_attempts failed, retrying..." | ||||||||||||||||||||||||||||||||
| sleep 5 | ||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||
| echo "Test passed on attempt $attempt" | ||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||
| RUSTFLAGS="-D warnings" eval "$subtest" | ||||||||||||||||||||||||||||||||
| if [ "$subtest" == "cargo-test-sbf -p e2e-test" ]; then | ||||||||||||||||||||||||||||||||
| pnpm --filter @lightprotocol/programs run build-compressed-token-small | ||||||||||||||||||||||||||||||||
| RUSTFLAGS="-D warnings" eval "$subtest -- --test test_10_all" | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
Comment on lines
+93
to
+118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trim Splitting on commas leaves each element with a leading space, so the literal comparison on Line 115 never matches - for subtest in "${sub_tests[@]}"
+ for subtest in "${sub_tests[@]}"
do
- echo "$subtest"
+ subtest="${subtest## }"
+ echo "$subtest"🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||
|
Comment on lines
+34
to
+120
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 5 months ago To fix this problem, explicitly set the permissions:
contents: readdirectly after the
Suggested changeset
1
.github/workflows/programs.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.