Repository navigation
fix: expose settlement event archival entrypoint - #1269
Chiwendu25 wants to merge 3 commits into
Conversation
|
@Chiwendu25 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! 🚀 |
|
Thanks for the contribution! We reviewed this PR while merging the open queue and couldn't merge it yet. Here's what needs fixing:
This branch also has merge conflicts with |
…archival-as-entrypoint Resolves merge conflicts against CalloraOrg/Callora-Contracts@2730f2d (95 commit(s) behind) so the PR is mergeable.
…ntrypoint Restores the two files the branch had deleted, wires a per-developer ActiveEvent producer into receive_payment/batch_receive_payment so the FIFO archive cursor has data to move, exposes archive_events as a contract entrypoint capped by MAX_BATCH_SIZE, and documents the storage cost in the archive module rustdoc. Tests that the maintainer flagged as calling non-existent functions are replaced by a compiled test module (test_archive_entrypoint) covering the producer, the FIFO cursor, the cap and the empty case.
|
@greatest0fallt1me — thanks for the review. I've pushed an update to this branch ( What was restored / implemented
Verification (local, real toolchain)
Checks |
Overview
This PR makes the previously dead
archive::archive_eventslogic reachable from a contract entrypoint and adds a producer that recordsActiveEvententries per developer, so the FIFO cursor actually has data to move. It also caps archival batch size via the existingMAX_BATCH_SIZEand documents the storage cost of the chosen design in the module rustdoc.Related Issue
Changes
🗄️ Settlement Event Archival
[MODIFY]
contracts/settlement/src/archive.rsMAX_BATCH_SIZEwhen movingActiveEventpayloads toArchivedEvent.[MODIFY]
contracts/settlement/src/lib.rsarchive_events(developer, batch_size)as a contract entrypoint.ActiveEvententries per developer so archival has data to move.[MODIFY]
contracts/settlement/src/settlement_tests.rsActiveEvententries andarchive_eventsmoving them toArchivedEvent.batch_sizeis capped byMAX_BATCH_SIZE.Verification Results
archive_eventsexposed as entrypoint inlib.rsActiveEventand archival moves themActiveEvent; archival moves toArchivedEventMAX_BATCH_SIZEand testedarchive.rs; covered insettlement_tests.rsarchive.rsrustdocSecurity and Failure Modes
MAX_BATCH_SIZE, preventing unbounded iteration / gas exhaustion in a single call.Compatibility
Closes #1148