Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory: test for extending the TTL #426

Merged
merged 10 commits into from
Feb 6, 2025
Merged

Conversation

gangov
Copy link
Collaborator

@gangov gangov commented Jan 23, 2025

No description provided.

@gangov gangov self-assigned this Jan 23, 2025
@gangov gangov linked an issue Jan 23, 2025 that may be closed by this pull request
@gangov gangov requested a review from ueco-jb February 5, 2025 11:02
@ueco-jb
Copy link
Member

ueco-jb commented Feb 5, 2025

Actually why is this one a draft still?

@ueco-jb ueco-jb marked this pull request as ready for review February 5, 2025 11:05
@gangov
Copy link
Collaborator Author

gangov commented Feb 5, 2025

Actually why is this one a draft still?

it seems I missed it - I remember us talking about the results of this test, but I also never added you as a reviewer

Copy link
Member

@ueco-jb ueco-jb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those assertions doesn't make any sense.

contracts/factory/src/tests/queries.rs Show resolved Hide resolved
contracts/factory/src/tests/queries.rs Outdated Show resolved Hide resolved
contracts/factory/src/tests/queries.rs Outdated Show resolved Hide resolved
@gangov
Copy link
Collaborator Author

gangov commented Feb 5, 2025

the -1 is there as a safeguard against small time differences - eg. when you update the TTL but the ledger progresses. It'll be off by 1 in such case, so that's why I've decided to use PERSISTENT_BUMP_AMOUNT - 1.

As for the instance TTL - we're supposed to reset it to a fixed value (INSTANCE_BUMP_AMOUNT) each time it passes a certain tresshold (INSTANCE_LIFETIME_THRESHOLD) - that's why I thought it'd be fine to use an exact match.

the persistent TTL, depends on the current ledger sequence and might not change by exactly the bump amount every time, so instead of comparing the difference, I tried to verify that it remains above the minimum threshold.

@gangov gangov requested a review from ueco-jb February 5, 2025 16:38
Copy link
Member

@ueco-jb ueco-jb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ueco-jb ueco-jb merged commit 0370f67 into main Feb 6, 2025
3 checks passed
@ueco-jb ueco-jb deleted the 425-factory-test-for-extending-ttl branch February 6, 2025 10:14
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.

Factory: test for extending ttl
2 participants