feat(contracts): governance benchmarks, insurance pool deploy profile, spec/ABI coverage - #580
Merged
Levi-Ojukwu merged 1 commit intoJul 26, 2026
Conversation
…, spec/ABI coverage Closes Invoice-Liquidity-Network#522 Closes Invoice-Liquidity-Network#523 Closes Invoice-Liquidity-Network#524 Closes Invoice-Liquidity-Network#525 - Add execution-cost benchmarks for iln_governance (create_proposal, cast_vote, delegate_votes) with a baseline.json, mirroring the existing invoice_liquidity pattern. Generalize scripts/check_benchmark_regression.sh to check multiple contracts (invoice_liquidity + iln_governance) (Invoice-Liquidity-Network#522). - Add insurance_pool to scripts/deploy-local.sh's contract list (it was silently missing), add scripts/deploy-insurance-pool.sh, and wire an opt-in "insurance" Docker Compose profile (insurance-pool-deploy service) into docker-compose.yml and docker-compose.test.yml for local/e2e testing without slowing down the default `docker compose up` (Invoice-Liquidity-Network#523). - Extend scripts/gen-spec.ts to also emit an insurance_pool spec under a new `contracts` key in docs/contract-spec.json, without touching the existing invoice_liquidity top-level fields (keeps scripts/generate-sdk.ts working unchanged) (Invoice-Liquidity-Network#524). - Generalize scripts/gen-abi.ts to loop over both contracts. Along the way, fixed two bugs that were producing an unusable docs/contract-abi.md: the return-type regex broke on multi-word types like `Result<(), ContractError>`, and ContractError wasn't found because it lives in errors.rs, not lib.rs (Invoice-Liquidity-Network#525).
brightpixel-dev
force-pushed
the
fix/issues-522-523-524-525
branch
from
July 26, 2026 22:58
f9a4aca to
3c0afa4
Compare
|
@brightpixel-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #522
Closes #523
Closes #524
Closes #525
What changed
#522 — Governance contract benchmark baselines
contracts/iln_governance/src/tests_benchmarks.rswith execution-cost benchmarks forcreate_proposal,cast_vote, anddelegate_votes, mirroring the existinginvoice_liquidity/tests_benchmarks.rspattern.contracts/iln_governance/benchmarks/baseline.jsonwith measured baselines.scripts/check_benchmark_regression.shto check a list of<contract-dir>:<baseline-file>pairs (nowinvoice_liquidity+iln_governanceby default) instead of being hardcoded to one contract.docs/benchmarks.mdandCONTRIBUTING.mdaccordingly.#523 — Docker Compose profile for local insurance pool testing
scripts/deploy-local.shwas silently missinginsurance_poolfrom its contract list — added it, so./scripts/deploy-local.shnow deploys all 5 contracts as intended ("local dev needs all contracts available").scripts/deploy-insurance-pool.shto deploy/initialize just the insurance pool.insuranceDocker Compose profile (insurance-pool-deployservice) todocker-compose.ymlanddocker-compose.test.yml— run withdocker compose --profile insurance up insurance-pool-deploy. It's profile-gated (not part of the defaultdocker compose up) since it installs the Stellar CLI viacargo installon first run, which can take several minutes.INSURANCE_POOL_CONTRACT_IDenv var wiring to theindexer/notificationsservices, and documented all of the above indocs/local-development.md.#524 — Contract spec JSON for insurance pool
scripts/gen-spec.tsnow also emits aninsurance_poolspec, added under a newcontractskey indocs/contract-spec.json.InvoiceLiquidityContract) are left untouched for backward compatibility withscripts/generate-sdk.ts, which reads them directly — verified vianpx tsx --test scripts/generate-sdk.test.ts(5/5 passing).#525 — ABI generation for insurance pool
scripts/gen-abi.tsnow loops over both contracts instead of being hardcoded toinvoice_liquidity.docs/contract-abi.md(only 3 functions and 0 errors were ever captured forinvoice_liquidity): the return-type regex broke on multi-word types likeResult<(), ContractError>, and the errors regex only looked inlib.rs, butContractErroris defined inerrors.rs. Both contracts now render their full function/error lists correctly.Why
docker-composeprofile for local insurance pool testing #523 — the insurance pool contract had no way to be deployed/tested locally alongside the other contracts.How to test
cd contracts/iln_governance && cargo test benchmark -- --nocapture— 4/4 passing,BENCHMARKlines matchbenchmarks/baseline.json.cargo build -p iln_governance -p insurance_poolandcargo clippy --all-targets -p iln_governance— clean.docker compose config --quietanddocker compose -f docker-compose.test.yml config --quiet— both validate;docker compose config --services(no profile) confirmsinsurance-pool-deployis excluded by default, and--profile insurance config --servicesconfirms it's included when opted in.npx tsx scripts/gen-spec.ts/npx tsx scripts/gen-abi.ts— regeneratedocs/contract-spec.json/docs/contract-abi.mdidempotently (diff is empty on a second run).npx tsx --test scripts/generate-sdk.test.ts— 5/5 passing, confirmingdocs/contract-spec.json's top-level shape is unchanged.