Skip to content

AIP #61 v5: Validator Worker workflow #360

@elpiel

Description

@elpiel

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions