Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/contracts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ jobs:
stellar contract build --manifest-path contracts/oracle-adapter/Cargo.toml
stellar contract build --manifest-path contracts/vault/Cargo.toml

- name: Check WASM size budgets
run: |
node -e '
const fs = require("fs");
const path = require("path");
const budgets = JSON.parse(fs.readFileSync("contracts/size-budget.json", "utf8"));
let failed = false;
for (const [name, budget] of Object.entries(budgets)) {
const file = path.join("target/wasm32v1-none/release", `${name}.wasm`);
if (fs.existsSync(file)) {
const size = fs.statSync(file).size;
console.log(`[SIZE] ${name}: ${size} bytes (budget: ${budget} bytes)`);
if (size > budget) {
console.error(`[ERROR] ${name} exceeds budget (${size} > ${budget})`);
failed = true;
}
}
}
if (failed) process.exit(1);
'

# Published with the artifacts, so the hash of a deployed contract's wasm
# can be checked against the commit that built it.
- name: Record wasm checksums
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `ci`: Add `contracts/size-budget.json` establishing tracked byte thresholds for each contract, enforced in `.github/workflows/contracts-ci.yml` (#94).
- `ci`: Add `deny.toml` and `cargo-deny` check in `.github/workflows/security.yml` to enforce license compliance (Apache-2.0, MIT, BSD) and deny unknown registries (#91).
- Stage 1 developer-experience tooling:
- `.gitattributes` normalizing all tracked text to LF (`*.sh`, `*.rs`, `*.ts`, `*.md`, and the other text formats in the tree) and marking `Cargo.lock` and `package-lock.json` as generated. The tree was re-normalized once, and a new **Line Endings** workflow fails any pull request that reintroduces CRLF into the index (#85).
Expand Down
7 changes: 7 additions & 0 deletions contracts/size-budget.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rwa_asset": 65536,
"registry": 65536,
"compliance": 65536,
"governance": 65536,
"oracle_adapter": 65536
}
Loading