Repository navigation
fix(registry): validate before cooldown and extend cooldown TTL - #1450
YoungBoss04 wants to merge 3 commits into
Conversation
|
@YoungBoss04 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! 🚀 |
9e7723e to
f9cf4ae
Compare
|
@YoungBoss04 Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
Removes the .vscode task and the .lfk loader this branch picked up (delete .vscode/extensions.json, delete .vscode/launch.json, delete .vscode/settings.json, delete .vscode/spellright.dict, delete .vscode/tasks.json, delete public/fonts/fa-solid.lfk). No functional change to the branch's own work.
|
@YoungBoss04 Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
|
This PR came from a machine infected with the PolinRider malware. We stripped the malware files, but the code itself also contains corrupted changes (random character mutations / sabotage), so it cannot be merged. Found in |
Overview
This PR fixes three correctness gaps in
callora-registry: registration entrypoints now validateoffering_idandmetadatabefore checking the per-developer cooldown,DeveloperCooldownentries get a TTL extension so they no longer archive mid-cooldown, andis_offering_registeredbecomes total by returningOk(false)for malformed ids. It also revives the 9 previously ignoredmetadata_validation.rstests.Related Issue
Changes
🛡️ Validation Order in Registration Entrypoints
contracts/registry/src/lib.rsregister_offeringnow validatesoffering_idandmetadatabeforeadmin::require_cooldown, so a malformed id during an active cooldown returnsInvalidOfferingIdinstead ofAdminCooldownActive.register_offering_with_gatefollows the same order and additionally validates before the token balance read.⏱️ Cooldown TTL Extension
contracts/registry/src/admin.rsupdate_cooldownnow callsextend_ttlon theDeveloperCooldownentry with a lifetime at leastCOOLDOWN_SECONDS(in ledgers) plus a margin.require_cooldownextends the TTL on read when the entry is present, so markers no longer archive mid-cooldown.🔍 Total
is_offering_registeredViewcontracts/registry/src/lib.rsis_offering_registeredreturnsOk(false)for malformed ids instead ofErr(InvalidOfferingId); a malformed id can never be registered, sofalseis truthful.get_offeringcontinues to returnInvalidOfferingIdfor malformed ids.✅ Revived Tests
contracts/registry/tests/metadata_validation.rs#[ignore]from the 9 tests (e.g.rejects_control_character_in_offering_id,rejects_empty_offering_id) and adjusted only as far as needed for the new total view.Verification Results
grep -n 'stale test' contracts/registryreturns nothing#[ignore]removed from the 9 testscargo test -p callora-registrypassescargo fmt --all -- --checkandcargo test --workspacepassInvalidOfferingIdAdminCooldownActiveDeveloperCooldownTTL after registration ≥ configured bump − 1is_offering_registered(malformed)returnsOk(false)get_offering(malformed)returnsErr(InvalidOfferingId)InvalidOfferingIdmetadata_validationtests passCloses #1424