Skip to content

feat: lazy pool-state loading benchmark & docs, contract SDK-27 fixes (closes #712) - #887

Merged
Smartdevs17 merged 3 commits into
Smartdevs17:mainfrom
kaluuba-org:feat/712-lazy-pool-state
Sep 1, 2026
Merged

feat: lazy pool-state loading benchmark & docs, contract SDK-27 fixes (closes #712)#887
Smartdevs17 merged 3 commits into
Smartdevs17:mainfrom
kaluuba-org:feat/712-lazy-pool-state

Conversation

@kaluuba-org

Copy link
Copy Markdown
Contributor

Summary

Adds the missing documentation deliverable for lazy pool-state on-demand
loading and unblocks the benchmarks runner, closing #712.

The lazy pool-state implementation itself (epoch-keyed snapshot cache,
on-demand build, explicit invalidation, API-service caching and monitoring)
was already merged via #721/#883. This PR adds the remaining piece — the
docs/POOL_STATE_LAZY_LOADING.md reference — plus SDK-27 compatibility fixes
in two contracts that the benchmark runner depends on.

Closes #712

Changes

  • docs/POOL_STATE_LAZY_LOADING.md (new): design of the epoch-keyed
    PoolStateTempKey::Snapshot(pool, epoch) cache, contract surface and
    entrypoints (get_pool_state, get_pool_state_epoch, get_pool_state_metrics,
    invalidate_pool_state), API-service caching, consistency rules, the
    <50 ms performance target with the benchmark-evidence status, and monitoring.
  • bridge (lending_bridge.rs): #[contractevent] topic names exceeded the
    32-char cap once snake-cased; pinned shorter topic names via
    #[contractevent(topics = [...])]. cargo check -p bridge passes.
  • pool-factory (lib.rs): SDK-27 drift — Address::from_contract_id
    env.current_contract_address(), and dropped useless usize casts for the
    Vec::get/Vec::set index APIs. cargo check -p stellarlend-pool-factory
    passes.

Notes

  • This branch is stacked on fix/hello-world-build-repair (fix(hello-world): repair contract lib build after merged refactor (#884) #886). Its diff
    against upstream/main therefore includes the fix(hello-world): repair contract lib build after merged refactor (#884) #886 build-repair until that
    PR merges.
  • The benchmark runner (cargo check -p stellarlend-benchmarks) still cannot
    build due to a pre-existing soroban-sdk 27 testutils × #[contracttype]
    incompatibility (see the doc's "Current status / blocker": contracttypes at
    storage.rs:3, rate_limiter.rs:134, mev_protection.rs:70). This is
    unrelated to pool-state and tracked as a follow-up; the doc records the exact
    block and how to run the suite once resolved.
  • hello-world's test suite remains broken on upstream main (stale tests,
    missing proptest dev-dependency); out of scope here.

Test plan

  • cargo check -p hello-world passes (26 pre-existing warnings)
  • cargo check -p bridge passes
  • cargo check -p stellarlend-pool-factory passes
  • cargo check -p stellarlend-benchmarks — blocked (documented above)

…artdevs17#884)

Upstream main (3b731f2) left the hello-world contract library with 93 compile
errors after the architectural refactor in Smartdevs17#884. This repairs the crate so
cargo check -p hello-world passes: restored the mangled get_legacy_risk_params
body and removed the duplicate get_risk_params in risk_params.rs, restored the
dropped timelock module declaration in lib.rs, and fixed SDK-27 API drift
(sequence(), ReentrancyGuard::new_with_key 3-arg form, is_zero_address via XDR,
Vec::remove(u32), typed flags), enum/structural mismatches (CircuitBreakerStatus
Paused/Emergency variants, RecoveryRequest.ready_at, CircuitBreakerState
construction), missing GovernanceError/DebtTokenError variants, the missing
From<EmergencyWithdrawalError> impl, and shared-events conversion helpers.
…ry index ops

- lending_bridge: contractevent topic symbols exceed the 32-char cap once
  snake-cased; pin shorter topic names via #[contractevent(topics = [...])]
- pool-factory: replace Address::from_contract_id with
  env.current_contract_address(); drop usize casts for Vec index APIs

Unblocks building the benchmarks runner (cargo check -p bridge and
-p stellarlend-pool-factory now pass).
Covers the epoch-keyed snapshot cache, contract surface and entrypoints,
API-service caching, consistency rules, the <50ms performance target with
benchmark evidence status, and monitoring. (closes Smartdevs17#712)
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@kaluuba-org is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@kaluuba-org 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

@Smartdevs17
Smartdevs17 merged commit 3af6e99 into Smartdevs17:main Sep 1, 2026
1 of 2 checks passed
@Smartdevs17

Copy link
Copy Markdown
Owner

Thanks for contributing! The changes have been merged. Feel free to leave a review or feedback.

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.

Implement lazy pool state initialization with on-demand loading

2 participants