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

Fix top of epoch nondeterminism by daisy chaining delegations and reinvesment icqs #707

Open
riley-stride opened this issue Apr 6, 2023 · 0 comments
Assignees
Labels

Comments

@riley-stride
Copy link
Contributor

riley-stride commented Apr 6, 2023

right now, each epoch stride:

  1. delegates new funds which triggets passive accounting claiming accrued rewards to withdrawal acct
  2. sends icq to query withdrawal acct bal (should contain rewards from step 1) and sweep it. now withdrawal acct has balance 0

1 and 2 are basically a race between the ICA that triggers PA, and the ICQ. They don't always land in 1 -> 2 order.

Whether 2 lands before 1 can sometimes depend on the type of epoch. For day epochs, we trigger unbondings first, then delegations, then the ICQ, so usually by the time the ICQ lands, the unbondings have already triggered PA. So 1 before 2 is more likely in day epochs and 2 before 1 is more likely in stride epochs.

Our monitoring stack assumes that 1 lands before 2, so when 2 lands before 1 we get false positive monitoring errors. That's annoying and we should fix it by making the order deterministic.

Proposed change: daisy chain 1 & 2 so that we have ordering and monitoring consistency. Kick off 2 in the delegation callback.

The logical change is: "at the top of each epoch, if our delegations fail don't also reinvest"

note: ideally at some point in the future we'd have ics999-like functionality that could bundle multiple queries and ica msgs into a single packet and execute them atomically on the host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants