Skip to content

[migrate] Avax Double Spend Bond Refunds

Ursa (9R) requested to merge ursa/bond-refund-125 into develop

This will remain in draft for 3 days to give the entire community a chance to review for correctness. Churn must remain paused until the migration is applied. The logic to determine the slash refund amounts is as follows.

  1. Gather security and bond events in the block range of double spend slashes:
$ PREFETCH=16 cosmoscan \
  'tx_events_listener(lambda h,txh,tx,txr,e: {"height":h,"event":e}, types={"security","bond"}),
    start=13562300, end=13569125, progress=True' \
  > security_and_bond_events
  1. Ensure none of the heights with bond slashes had a non-slash bond event:
$ jq -cr . security_and_bond_events | \
  agrind '*|json|count_distinct(event.bond_type) by height|where _countDistinct>1'
No data
  1. Determine the bond difference by node address at each height containing a bond slash event:
$ HEIGHTS=$(jq 'select(.event.bond_type == "\u0003")|.height' security_and_bond_events | sort -u | paste -sd,)
$ echo $HEIGHTS
13562300,13569122,13569123,13569124,13569125
$ tci nodes bond-diff --heights $HEIGHTS --node --long
...
total diff => -255,801.68572803
total bond change nodes => 110
  1. Cross reference sum of deltas on nodes endpoint to the sum of slash event amounts as sanity check:
$ jq -s '[.[]|select(.event.bond_type == "\u0003")|.event.amount|tonumber]|add' security_and_bond_events
25580168572803
Edited by Ursa (9R)

Merge request reports