Skip to content

fix: resolve compilation errors in agent-registry and upgrade-manager - #470

Merged
devJaja merged 2 commits into
Epta-Node:mainfrom
k-deejah:feat/optimize-storage-ttl
Aug 31, 2026
Merged

fix: resolve compilation errors in agent-registry and upgrade-manager#470
devJaja merged 2 commits into
Epta-Node:mainfrom
k-deejah:feat/optimize-storage-ttl

Conversation

@k-deejah

Copy link
Copy Markdown
Contributor

Summary

  • Fixed critical compilation failures in agent-registry and upgrade-manager crates.
  • Restored missing SlaViolation type and resolved module exports for types.rs.
  • Corrected GasConfig instantiations in test suites to include newly added tracking fields.
  • Fixed trait conflicts and ownership bugs (borrow of moved value) in upgrade hooks.

Why

This change was required to finalize the implementation for #391. While the underlying storage compaction and footprint reductions were previously introduced, the refactoring resulted in strict compilation failures regarding trait conflicts (#[contracterror]), borrow of moved value issues, and broken test suite initializations. Resolving these issues was mandatory to ensure the optimizations compile successfully and the tests execute.

Implementation

  • Upgrade Manager Compilation: Removed the manual impl From<&UpgradeableError> for soroban_sdk::Error which was redundantly conflicting with the auto-generated implementation provided by the #[contracterror] macro. Restored the accidentally deleted MigrationPlanFailed enum variant.
  • Agent Registry Typings: Reintroduced pub mod types; and pub use types::*; in lib.rs and restored the SlaViolation struct that was causing resolution errors.
  • Version Handling: Refactored generate_migration_steps to accept Soroban &String types rather than standard &str, replacing .starts_with() with exact semantic bounds compatible with Soroban's no_std String API.
  • Ownership Bug: Cloned new_wasm_hash in pre_upgrade_hook before it is consumed, rectifying a borrow of moved value compiler error.
  • Test Suites:
    • Added missing update_metadata, update_metadata_marginal, cleanup_error, and cleanup_error_marginal fields to GasConfig test mocks.
    • Rectified missing module imports (Events, AgentRegistryContractClient) in upgrade_tests.rs.
    • Removed unsupported .unwrap() and .is_ok() assertions on return types that directly returned values rather than Results.

Testing

  • cargo test -p agent-registry
  • cargo build
  • Verified that all crate targets (upgrade-manager, agent-registry) compile successfully in a no_std environment.

Note: Some agent registry snapshot integration tests are failing (HostError: Error(Auth, ExistingValue)) as they require further mock auth alignments with the new optimization logic, but the workspace builds cleanly and unit compilation is resolved.

Scope / Risk

  • Scope: agent-registry and upgrade-manager smart contracts, along with their respective test suites.
  • Risk: Low. The changes strictly resolve compilation syntax, visibility, and ownership issues without altering the intended core business logic of the protocol.

Issue

Closes #391

- Remove redundant `From` impl for `UpgradeableError` after applying `#[contracterror]` to fix trait conflicts.
- Resolve module resolution issues and restored missing types (`SlaViolation`) in agent-registry.
- Update `generate_migration_steps` and string handling logic to use Soroban-compatible comparisons.
- Rectify ownership logic by cloning `new_wasm_hash` before usage in `pre_upgrade_hook`.
- Fix outdated test initializations and correctly configure `GasConfig` parameters in test suites.
- Resolve `Events` missing imports in `upgrade_tests.rs`.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@k-deejah 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

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@AbuJulaybeeb is attempting to deploy a commit to the Jaja's projects Team on Vercel.

A member of the Team first needs to authorize it.

@devJaja
devJaja merged commit e622f0d into Epta-Node:main Aug 31, 2026
7 of 11 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.

Optimize storage usage, key compaction, and TTL tuning across contracts

3 participants