Skip to content

Commit cde5688

Browse files
Merge branch 'main' into ak-add-polkadot-parachain-2
2 parents 588566e + d7bb226 commit cde5688

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5483
-1052
lines changed

.claude/commands/review-pr.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Review pull request #$ARGUMENTS
2+
3+
Fetch the PR diff and details using `gh pr view` and `gh pr diff`, then analyze for:
4+
5+
1. **Code Quality**
6+
- Rust idioms and Polkadot SDK patterns
7+
- Error handling and unwrap usage
8+
- Code clarity and maintainability
9+
10+
2. **Security**
11+
- Unsafe code blocks
12+
- Input validation
13+
- Access control in pallets
14+
15+
3. **Performance**
16+
- Weight/benchmark implications
17+
- Storage access patterns
18+
- Unnecessary allocations
19+
20+
4. **Testing**
21+
- Test coverage for new code
22+
- Edge cases handled
23+
24+
5. **Breaking Changes**
25+
- API compatibility
26+
- Migration requirements
27+
28+
Provide specific feedback with file paths and line numbers.

.github/workflows/check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,9 @@ jobs:
146146
run: |
147147
cargo test -p bulletin-westend-runtime
148148
149+
- name: Run (Westend) XCM integration tests
150+
run: |
151+
unset SKIP_WASM_BUILD
152+
cargo test -p bulletin-westend-integration-tests
153+
149154
# TODO: check benchmarks

.github/workflows/integration-test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ concurrency:
1919
env:
2020
NODE_VERSION: 22
2121
POLKADOT_SDK_VERSION: polkadot-stable2512
22+
POLKADOT_SDK_COMMIT: 81a3af9830ea8b6ff64b066b73b04bb3b675add5
2223
POLKADOT_SDK_BIN_DIR: ${{ github.workspace }}/.polkadot-sdk-bin
2324
ZOMBIENET_VERSION: v1.3.138
2425
ZOMBIENET_BIN_DIR: ${{ github.workspace }}/.zombienet-bin
@@ -52,7 +53,7 @@ jobs:
5253
id: polkadot-sdk-cache
5354
with:
5455
path: ${{ env.POLKADOT_SDK_BIN_DIR }}
55-
key: polkadot-sdk-${{ env.POLKADOT_SDK_VERSION }}-binaries
56+
key: polkadot-sdk-${{ env.POLKADOT_SDK_VERSION }}-${{ env.POLKADOT_SDK_COMMIT }}-binaries
5657
# Download and extract binaries if cache missed
5758
- name: Download Polkadot SDK binaries
5859
if: steps.polkadot-sdk-cache.outputs.cache-hit != 'true'
@@ -70,7 +71,7 @@ jobs:
7071
# TODO: remove when released: https://github.com/paritytech/polkadot-sdk/pull/10662
7172
git clone https://github.com/paritytech/polkadot-sdk.git
7273
cd polkadot-sdk
73-
git reset --hard b2bcb74b13f1a1e082f701e3e05ce1be44d16790
74+
git reset --hard $POLKADOT_SDK_COMMIT
7475
cargo build -p polkadot-omni-node -r
7576
cd ..
7677
cp polkadot-sdk/target/release/polkadot-omni-node .
@@ -139,7 +140,7 @@ jobs:
139140
id: polkadot-sdk-cache
140141
with:
141142
path: ${{ env.POLKADOT_SDK_BIN_DIR }}
142-
key: polkadot-sdk-${{ env.POLKADOT_SDK_VERSION }}-binaries
143+
key: polkadot-sdk-${{ env.POLKADOT_SDK_VERSION }}-${{ env.POLKADOT_SDK_COMMIT }}-binaries
143144
- name: Cache Zombienet
144145
uses: actions/cache@v3
145146
id: zombienet-cache
@@ -181,6 +182,10 @@ jobs:
181182
working-directory: examples
182183
run: just run-test-store-big-data "${{ env.TEST_DIR }}"
183184

185+
- name: Test authorize-preimage-and-store (Westend parachain)
186+
working-directory: examples
187+
run: just run-test-authorize-preimage-and-store "${{ env.TEST_DIR }}"
188+
184189
- name: Stop services (Westend parachain)
185190
if: always()
186191
working-directory: examples
@@ -212,6 +217,10 @@ jobs:
212217
working-directory: examples
213218
run: just run-test-store-big-data "${{ env.TEST_DIR }}"
214219

220+
- name: Test authorize-preimage-and-store (Polkadot solochain)
221+
working-directory: examples
222+
run: just run-test-authorize-preimage-and-store "${{ env.TEST_DIR }}"
223+
215224
- name: Stop services (Polkadot solochain)
216225
if: always()
217226
working-directory: examples

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
- name: bulletin-westend
1818
package: bulletin-westend-runtime
1919
path: runtimes/bulletin-westend
20+
- name: bulletin-paseo
21+
package: bulletin-westend-runtime
22+
path: runtimes/bulletin-westend
2023
- name: bulletin-polkadot
2124
package: bulletin-polkadot-runtime
2225
path: runtimes/bulletin-polkadot

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ package-lock.json
1919
.papi/
2020

2121
# Local test files
22-
examples/retrieved_picture.*
2322
kubo/
2423
zombienet-*

CLAUDE.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ cargo clippy --all-targets --all-features --workspace -- -D warnings
4848

4949
# Format check
5050
cargo +nightly fmt --all -- --check
51+
taplo format --config .config/taplo.toml
52+
zepter run --config .config/zepter.yaml
5153
```
5254

5355
## Run Commands
@@ -153,3 +155,55 @@ The Polkadot SDK provides:
153155
- IPFS idle connection timeout: 1 hour
154156
- Node supports litep2p/Bitswap
155157
- Solochain validators need BABE and GRANDPA session keys
158+
159+
## Code Review Guidelines (Parity Standards)
160+
161+
These guidelines are used by the Claude Code review bot and should be followed by all contributors.
162+
163+
### Rust Code Quality
164+
165+
- **Error Handling**: Use `Result` types with meaningful error enums. Avoid `unwrap()` and `expect()` in production code; they are acceptable in tests.
166+
- **Arithmetic Safety**: Use `checked_*`, `saturating_*`, or `wrapping_*` arithmetic to prevent overflow. Never use raw arithmetic operators on user-provided values.
167+
- **Naming**: Follow Rust naming conventions (snake_case for functions/variables, CamelCase for types).
168+
- **Complexity**: Prefer simple, readable code. Avoid over-engineering and premature abstractions.
169+
- **No useless comments**: Comments should mostly explain **why** things are done, not **how**, the code should be readable enough to explain the how.
170+
171+
### FRAME Pallet Standards
172+
173+
- **Storage**: Use appropriate storage types (`StorageValue`, `StorageMap`, `StorageDoubleMap`, `CountedStorageMap`).
174+
- **Events**: Emit events for all state changes that external observers need to track.
175+
- **Errors**: Define descriptive error types in the pallet's `Error` enum.
176+
- **Weights**: All extrinsics must have accurate weight annotations. Update benchmarks when logic changes.
177+
- **Origins**: Use the principle of least privilege for origin checks.
178+
- **Hooks**: Be cautious with `on_initialize` and `on_finalize`; they affect block production time in solochains and can brick parachains. Never panic or do unbounded iteration in them. Always benchmark them properly.
179+
180+
### Security Considerations
181+
182+
- **No Panics in Runtime**: Runtime code must never panic. Use defensive programming.
183+
- **Bounded Collections**: Use `BoundedVec`, `BoundedBTreeMap` etc. to prevent unbounded storage growth.
184+
- **Input Validation**: Validate all user inputs at the entry point.
185+
- **Storage Deposits**: Consider requiring deposits for user-created storage items that are returned once the item is cleared.
186+
187+
### Testing Requirements
188+
189+
- **Unit Tests**: All new functionality requires unit tests.
190+
- **Edge Cases**: Test boundary conditions, error paths, and malicious inputs.
191+
- **Integration Tests**: Complex features should have integration tests using `sp-io::TestExternalities`.
192+
- **Benchmark Tests**: Features affecting weights should have benchmark tests.
193+
194+
### PR Requirements
195+
196+
- **Single Responsibility**: Each PR should address one concern.
197+
- **Tests Pass**: All CI checks must pass (`cargo test`, `cargo clippy`, `cargo fmt`).
198+
- **No Warnings**: Code should compile without warnings.
199+
- **Documentation**: Public APIs require rustdoc comments.
200+
201+
### Using the Claude Review Bot
202+
203+
The repository has a Claude Code review bot that automatically reviews PRs. You can also interact with it:
204+
205+
- **@claude** - Mention in any comment to ask questions or request help
206+
- **Assign to claude[bot]** - Assign an issue to have Claude analyze and propose solutions
207+
- **Label with `claude`** - Add the `claude` label to an issue for Claude to investigate
208+
209+
The bot enforces these guidelines and provides actionable feedback with fix suggestions.

0 commit comments

Comments
 (0)