Add sponsored announcements to Stellar sender - #133
Conversation
|
@OlyraCreations 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! 🚀 |
|
Rebase on latest |
|
Thanks so much for the feed back |
|
Merge conflicts against develop after the merge cascade. Rebase and CI should look different against the fixed workspace. |
PR wraith-protocol#133's "Known repository issue" also flagged the underlying workspace warning cluster as out-of-scope of their sponsored-announcement change but blocking CI hygiene. This commit is the cleanup pass. * stellar/stealth-registry/src/lib.rs: replace unused `Vec` import with the `IntoVal` trait actually invoked at the two `emit_metric` sites. * stellar/wraith-names/src/lib.rs: silence the constant `DELAY_WINDOW` which the cargo dead-code lint cannot link to a real use; delete two scaffold locals (`dot_pos`, `dot_count`) that were declared with `mut` but never read in the validate_name body. * stellar/stealth-sender/tests/fee_tests.rs: drop two genuinely unused imports (`testutils::Events as _`, `token::TokenInterface as _`); delete the dead `Harness.fee_recipient` field which was initialised but never asserted against by any of the six fee tests. * stellar/stealth-sender/tests/sac_compat.rs: drop the same two unused imports. * stellar/stealth-sender/tests/mocks/*.rs: drop the unused `token` import from five mocks where the file does not `impl token::Interface`. `token_immutable_safe.rs` is left untouched — its `token` import is in fact used by `impl token::Interface for ImmutableSafeToken`. Note: cargo's `dead_code` lint emits false positives on the inner-impl `mint` / `is_authorized` helpers in these mocks — those are accessed through the soroban-generated contract client (`token_client.is_authorized(...)`) and through `as_contract(&id, || { <MockToken>::mint(...) })` callbacks, both of which cargo can't trace. Confirmed via grep `.github/workflows/*.yml` that no `RUSTFLAGS=-D warnings` is set, so the warnings are noise rather than build failures. Keeping the mock helpers unmodified.
…col#101) - Add SponsoredEntry contracttype struct (sender, token, amount, scheme_id, stealth_address, ephemeral_pub_key, metadata) - Add SenderError::BatchTooLarge = 15 + SPONSORED_MAX_ENTRIES = 20 - Add sponsored_announce(env, sponsor, entries): * sponsor.require_auth() recorded once; per-entry sender auth deduped via Vec::contains to avoid AuthError::ExistingValue * per-entry asset policy, token transfer, announce (atomic) * BATCH_SEND_COUNT/VOLUME/SIZE metrics tagged with sponsor - Fix bench harness: switched hardcoded scheme_id=1 across announce, send, batch_send, sponsored_announce to stealth_announcer::STELLAR_V2_SCHEME_ID; raise metadata_len sweep start to 1u32 to satisfy v2 view-tag derivation - Update PERF.md Sponsored Announcement Cost breakdown with the freshly-measured per-entry numbers (batch_size=1..20) - 7 new unit tests in stealth-sender/src/lib.rs: sponsored_announce_single_entry, _at_cap_succeeds, _cap_exceeded, _empty_rejected, _not_initialized_rejected, _emits_one_announcement_per_entry, _token_not_allowed, _mid_bundle_failure_rolls_back All 23 cargo test --workspace runs green; the futurenet Horizon fee-account check in integration-tests/sponsored.rs is unchanged (network test, #[ignore]).
Soroban SDK regenerates test_snapshots/* deterministically when contract emit shape changes. Snapshot drift follows the new sponsored_announce metric events and the v2 announcer bucketed event topics.
|
No CI signal on this branch. It predates recent workflow fixes on develop (pnpm 10 corepack pin, ci.yml trigger updates, etc). Rebase against latest |
Summary
Adds the fee-payer/sponsored announcement pattern requested in #101. Platforms can submit multiple independently authenticated announcement entries in one Soroban invocation while a sponsor supplies the transaction fee through Stellar fee-bump mechanics.
Fixes #101
What changed
SponsoredEntrytostellar/stealth-sender/src/lib.rswith the per-entry sender, token, amount, scheme ID, stealth address, ephemeral public key, and metadata.sponsored_announce(sponsor, entries).SponsoredBatchTooLarge = 6and enforced a maximum of 20 entries.stellar/integration-tests/sponsored.rsto verify a submitted futurenet transaction records the sponsor as Horizon'sfee_account.stellar/bench/src/main.rs.stellar/PERF.md.Acceptance criteria
SenderError::SponsoredBatchTooLarge.PERF.md.FUTURENET_TX_HASHandFUTURENET_SPONSOR_ADDRESSagainst Horizon after a fee-bumped transaction is submitted.Validation
cargo test -p stealth-sender: passed.Known repository issue
The full
cargo test --workspacecheck is currently blocked by pre-existing unrelated errors instealth-registry/src/lib.rs(mismatched closing delimiter). Workspace-wide formatting also reports existing formatting differences outside the files changed by this PR.The pre-existing untracked root
package-lock.jsonwas not included in this PR.