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

AIP #61 v5: Validator Worker workflow #360

Open
Tracked by #385
elpiel opened this issue Aug 13, 2021 · 0 comments
Open
Tracked by #385

AIP #61 v5: Validator Worker workflow #360

elpiel opened this issue Aug 13, 2021 · 0 comments
Assignees

Comments

@elpiel
Copy link
Member

elpiel commented Aug 13, 2021

Part of AIP#61 - AdEx v5 #338

AIP#61: AdEx v5: significantly cheaper channels (full details here)

Workflow

  1. GET /campaign/all, and for each channel:
    Extract all unique Channels and hook up the campaign Validators to them. This is necessary since the campaign holds information about the validators urls in V5.
  2. (Chanel Tick begins) GET /channel/:id/spender/all & GET channel/:id/accounting
  3. Next validate:
  • sum(Accounting.spenders) == sum(Accounting.earners) just by using Balances<CheckedState>
  • Validate each spender (GET channel/:id/spender/all response) spender.spender_leaf.total_deposit >= accounting.balances.spenders[spender.address]
  1. GET Last Approved State & fetch GET Last Approved NewState - since the NewState holds the actual balances and not the ApproveState.
  2. Validate change in balances & OUTPACE rule:
  • Change in balances - validate that there is a change in the balances (current Accounting.balances != NewState.blaances). If there are no changes, we will not create new states (NewState & ApproveState)

  • validate spender/earner amounts - each amount should increase , i.e.:

    • Accounting.balances.spenders[spender_address] > NewState.balances.spender[spender_address] &
    • Accounting.balances.earners[earner_address] > NewState.balances.earners[earner_address]
  • OUTPACE rules:

    • sum(accounting.balances.spenders) > sum(new_state.balances.spenders)
    • sum(accounting.balances.earners) > sum(new_state.balances.earners)

NOTE: leader/follower tick - We no longer need the producer::tick since we have the always up-to-date Accounting

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

No branches or pull requests

2 participants