Repository navigation
feat: enforce minimum stream duration, scale TTL, add descriptions - #855
Merged
Merged
Conversation
|
@Asta-wizard 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #847
closes #846
closes #845
closes #844
Implemented the four streamFi contract changes: a 60-second minimum for bounded
streams, duration-scaled instance TTL, an optional 128-byte description on both
creation paths, and a factory zero-deposit rejection test. The repository had
several pre-existing compile and test failures; those were repaired so the full
workspace suite and CI clippy now pass.
Verification
cargo fmt --all -- --check— clean.cargo clippy --all-targets -- -D warnings— clean.cargo clippy --workspace --exclude conduit-integration-tests --target wasm32-unknown-unknown -- -D warnings— clean.cargo test --workspace --no-fail-fast— all green (8 pre-existing testsignored; see below).
drip-stream145 passed,drip-factory53 passed / 2 ignored,drip-oracle86,token-vault80,drip-common44,drip-batch-processor25,
drip-governor16, integration suites 206 passed.#847 — Minimum stream duration
MIN_STREAM_DURATION = 60seconds andError::StreamDurationTooShort = 26.DripStream::initializerejects bounded streams shorter than 60s; open-endedstreams (
end_time == 0) are unaffected.DurationTooShort).rejection; updated overflow tests whose old 1–2 second fixtures were invalid.
#846 — Duration-scaled TTL
contracts/stream/src/ttl.rsaddsextend_to_for_remainingandbump_for_remaining. The target isclamp(remaining_ledgers + MIN_TTL, EXTEND_TTL, 6_312_000)at 5s/ledger.initialize,extend_duration,top_up_and_extend,resume, and the keeperbump_stream_instanceuse the stream's remaining duration.test that a one-year stream gets a longer instance TTL than a one-hour stream.
#845 — Optional description
initializeandFactory::create_streamacceptdescription: Option<String>(last parameter).Stream::DescriptionTooLong = 27/Factory::DescriptionTooLong = 34.DataKey::StreamDescription; exposed viaDripStream::description(). Batch paths passNone.#844 — Zero-deposit factory test
Added
create_stream_rejects_zero_deposit_before_governor_call, asserting thefactory returns its actual zero-deposit error (
InvalidDeposit) before anygovernor cross-contract call. Also added factory tests for the new minimum
duration and description limit.
Judgement calls
InvalidAmount; its zero-deposit variant isInvalidDeposit, so the test asserts that real error.protocol-level minimum for direct initializers.
strings are byte strings; this keeps the storage bound deterministic.
impl, missingStringimport,stale
initialize/create_streamsignatures, removedDataKey::StreamInfo,removed SDK
get_wasm, an over-long public function name, stale tests, anda 100-entry host-budget gas test.
factory deployment tests need a real WASM, two 100-entry batch tests and the
gas snapshot exceed the host budget, and one governor event-count test
reflects existing duplicate-event behavior.