Skip to content

feat: fixed router registry entry point bug - #1232

Merged
Maki-Zeninn merged 1 commit into
Maki-Zeninn:mainfrom
Jayydy:bug(router-registry)
Aug 31, 2026
Merged

feat: fixed router registry entry point bug#1232
Maki-Zeninn merged 1 commit into
Maki-Zeninn:mainfrom
Jayydy:bug(router-registry)

Conversation

@Jayydy

@Jayydy Jayydy commented Aug 31, 2026

Copy link
Copy Markdown

Pull Request

What changed

Here's a summary of what was changed and why each decision was made:

contracts/router-registry/src/lib.rs

Added two constants after MAX_CONSTRAINT_LEN, matching router-core exactly:

const INSTANCE_TTL_THRESHOLD: u32 = 17280 * 30; // ~30 days
const INSTANCE_TTL_EXTEND_TO: u32 = 17280 * 60; // ~60 days

Added router_common::extend_instance_ttl(&env, INSTANCE_TTL_THRESHOLD,
INSTANCE_TTL_EXTEND_TO); to all 16 public entry points: initialize, register,
register_with_check, bulk_register, get, is_deprecated, get_latest,
get_latest_with_constraint, deprecate, deprecate_all_versions, deprecate_many,
transfer_admin, admin, versions, get_all_versions, get_all_names,
get_entry_by_address.

The call is placed after require_auth() (so unauthorized callers don't extend
TTL) but before the admin check — consistent with how router-core handles it.
For read-only entry points that have no auth, it's the very first line.

One design note on is_deprecated: it was previously delegating to get(), which
would now create a double TTL bump. I inlined the storage read directly so
each entry point only bumps once.

contracts/router-common/src/lib.rs

Removed a pre-existing duplicate EVENT_ROLE_LIMITS_SET constant at line 245
that was causing a compile error (E0428: defined multiple times). The first
definition at line 62 has the more precise doc comment ("Emitted when the
super-admin changes the role-system limits") and was kept

How it was tested

Follow-up work

Checklist

  • [x ] Branch follows naming convention (feat/, fix/, docs/, etc.)
  • [ x] Tests added or updated
  • [ x] Tests pass locally (cargo test)
  • [x ] Code formatted (cargo fmt)
  • [ x] No clippy warnings (cargo clippy -- -D warnings)
  • [x ] PR title follows conventional commit format (type(scope): description)

Related Issues

Closes #1173

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Jayydy 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

@Maki-Zeninn
Maki-Zeninn merged commit d7f3370 into Maki-Zeninn:main Aug 31, 2026
8 of 13 checks passed
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.

bug(router-registry): no entry point extends instance storage TTL, unlike router-core and router-execution

3 participants