Skip to content

enforce a resource-based Stellar metadata limit - #259

Open
Nemenwa wants to merge 1 commit into
wraith-protocol:developfrom
Nemenwa:resource-based
Open

Nemenwa wants to merge 1 commit into
wraith-protocol:developfrom
Nemenwa:resource-based

Conversation

@Nemenwa

@Nemenwa Nemenwa commented Oct 21, 2026

Copy link
Copy Markdown

closes #225

Implemented a 1,024-byte metadata limit in the announcer contract. Oversized input now returns AnnouncerError::MetadataTooLong (code 1) before key validation. Audit tests cover 1,023-byte and 1,024-byte acceptance, 1,025-byte rejection, and resource ceilings.

The existing Soroban baseline measured the 1 KiB payload at 15,096 instructions, 1,610 memory bytes, and 1,216 event bytes, versus 4,288 event bytes at 4 KiB. I updated the audit finding with the rationale and measurements.

git diff --check and editor diagnostics passed. I couldn’t run the Cargo tests because cargo isn’t installed or available on PATH. The existing package-lock.json modification was left untouched.

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@Nemenwa 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! 🚀

Learn more about application limits

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking issues on this exact head:

  1. AnnouncerError::MetadataTooLong = 1 conflicts with the repository-wide allocation in stellar/ERRORS.md, which reserves 1000-1099 when stealth-announcer gains contract errors. Code 1 is already used by other public error enums, so raw protocol logs become ambiguous. Move this variant into the reserved range and document it in ERRORS.md; the required error-catalog step will otherwise fail once formatting is fixed.

  2. stellar/bench/src/lib.rs:55 still benchmarks metadata_len=4096 as a successful announcement. The required stellar-bench-pr job now panics with Error(Contract, #1) on that case. Remove or convert the obsolete success case, update the authoritative baseline/PERF artifacts, and keep an explicit rejection measurement/test if desired.

  3. This changes the public contract spec, but the checked-in TypeScript binding and stellar/abi/stealth_announcer.json still describe the old interface and contain no new error enum. Regenerate them with pnpm bindings:stellar and stellar/abi/update.sh.

  4. cargo fmt --all --check is currently red. Format the changed Rust files, and remove the unrelated root package-lock.json rewrite from this PR.

The implementation tests well once formatted: all 40 stealth-announcer tests and the full Stellar workspace suite passed locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Wave 10] Define and enforce a resource-based Stellar metadata limit

2 participants