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

manualTimer runs differently when each tick awaited #5547

Closed
turadg opened this issue Jun 8, 2022 · 1 comment · Fixed by #5606
Closed

manualTimer runs differently when each tick awaited #5547

turadg opened this issue Jun 8, 2022 · 1 comment · Fixed by #5606
Assignees
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol tooling repo-wide infrastructure
Milestone

Comments

@turadg
Copy link
Member

turadg commented Jun 8, 2022

What is the Problem Being Solved?

Different tasks are fired when using tickN. In some tests this affects the interest calculation. See // FIXME test result relies on awaiting each tick.

example from test-vaultFactory

using tickN:

    ℹ @@ tick:604800: 5n interest tick @@
    ℹ && running a task scheduled for 604800. &&
    ℹ @@ tick:1209600: 5n interest tick @@
    ℹ @@ tick:1814400: 5n interest tick @@
    ℹ @@ tick:2419200: 5n interest tick @@
    ℹ @@ tick:3024000: 5n interest tick @@
    ℹ @@ schedule task for:3628800, currently: 3024000 @@

using await tick() in a loop:

    ℹ @@ tick:604800: 5n interest tick with awaits @@
    ℹ && running a task scheduled for 604800. &&
    ℹ @@ tick:1209600: 5n interest tick with awaits @@
    ℹ @@ tick:1814400: 5n interest tick with awaits @@
    ℹ @@ tick:2419200: 5n interest tick with awaits @@
    ℹ @@ tick:3024000: 5n interest tick with awaits @@
    ℹ @@ schedule task for:3628800, currently: 3024000 @@
    ℹ @@ tick:3628800 @@
    ℹ && running a task scheduled for 3628800. &&
    ℹ @@ schedule task for:4233600, currently: 3628800 @@
    ℹ @@ tick:4233600 @@
    ℹ && running a task scheduled for 4233600. &&
    ℹ @@ schedule task for:4838400, currently: 4233600 @@
    ℹ @@ tick:4838400 @@
    ℹ && running a task scheduled for 4838400. &&
    ℹ @@ schedule task for:5443200, currently: 4838400 @@
    ℹ @@ tick:5443200 @@
    ℹ && running a task scheduled for 5443200. &&
    ℹ @@ schedule task for:6048000, currently: 5443200 @@
    ℹ @@ tick:6048000 @@
    ℹ && running a task scheduled for 6048000. &&
    ℹ @@ schedule task for:6652800, currently: 6048000 @@

Description of the Design

Security Considerations

Test Plan

@turadg turadg added the enhancement New feature or request label Jun 8, 2022
@Tartuffo Tartuffo added the Zoe package: Zoe label Jun 13, 2022
@Chris-Hibbert Chris-Hibbert added Inter-protocol Overarching Inter Protocol tooling repo-wide infrastructure and removed Zoe package: Zoe labels Jun 15, 2022
@Chris-Hibbert
Copy link
Contributor

adding await eventLoopIteration(); before await timer.tick(msg); in tickN in manualTimer makes this test pass, so I think it's just a matter of waiting enough turns for the messages to get processed.

I think that's a plausible interpretation of what tickN() should do. WDYT?

@mergify mergify bot closed this as completed in #5606 Jun 16, 2022
@Tartuffo Tartuffo added this to the Mainnet 1 milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol tooling repo-wide infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants