@wireio/stake 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireio/stake",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "description": "LIQ Staking Module for Wire Network",
5
5
  "homepage": "https://gitea.gitgo.app/Wire/sdk-stake",
6
6
  "license": "FSL-1.1-Apache-2.0",
@@ -702,6 +702,10 @@
702
702
  "name": "epoch_state",
703
703
  "writable": true
704
704
  },
705
+ {
706
+ "name": "withdraw_global",
707
+ "writable": true
708
+ },
705
709
  {
706
710
  "name": "active_list"
707
711
  },
@@ -1874,6 +1878,7 @@
1874
1878
  },
1875
1879
  {
1876
1880
  "name": "cranky",
1881
+ "writable": true,
1877
1882
  "signer": true
1878
1883
  },
1879
1884
  {
@@ -1945,6 +1950,76 @@
1945
1950
  }
1946
1951
  ]
1947
1952
  },
1953
+ {
1954
+ "name": "migrate_batch_orchestrator",
1955
+ "docs": [
1956
+ "One-shot migration: realloc BatchOrchestrator for the four per-op",
1957
+ "`*_started_epoch: u16` fields + restored `_reserved` buffer.",
1958
+ "Idempotent, ungated. `payer` covers the rent delta."
1959
+ ],
1960
+ "discriminator": [
1961
+ 130,
1962
+ 240,
1963
+ 40,
1964
+ 175,
1965
+ 53,
1966
+ 209,
1967
+ 232,
1968
+ 11
1969
+ ],
1970
+ "accounts": [
1971
+ {
1972
+ "name": "payer",
1973
+ "writable": true,
1974
+ "signer": true
1975
+ },
1976
+ {
1977
+ "name": "batch_orchestrator",
1978
+ "docs": [
1979
+ "is the only authorization needed; the op is idempotent."
1980
+ ],
1981
+ "writable": true
1982
+ },
1983
+ {
1984
+ "name": "system_program"
1985
+ }
1986
+ ],
1987
+ "args": []
1988
+ },
1989
+ {
1990
+ "name": "migrate_stake_metrics",
1991
+ "docs": [
1992
+ "One-shot migration: realloc StakeMetrics for new fields (mev_reward + _reserved)"
1993
+ ],
1994
+ "discriminator": [
1995
+ 183,
1996
+ 154,
1997
+ 168,
1998
+ 221,
1999
+ 78,
2000
+ 179,
2001
+ 112,
2002
+ 165
2003
+ ],
2004
+ "accounts": [
2005
+ {
2006
+ "name": "global_config"
2007
+ },
2008
+ {
2009
+ "name": "admin",
2010
+ "writable": true,
2011
+ "signer": true
2012
+ },
2013
+ {
2014
+ "name": "stake_metrics",
2015
+ "writable": true
2016
+ },
2017
+ {
2018
+ "name": "system_program"
2019
+ }
2020
+ ],
2021
+ "args": []
2022
+ },
1948
2023
  {
1949
2024
  "name": "migrate_user_record",
1950
2025
  "discriminator": [
@@ -1982,6 +2057,37 @@
1982
2057
  ],
1983
2058
  "args": []
1984
2059
  },
2060
+ {
2061
+ "name": "migrate_validator_info_batch",
2062
+ "docs": [
2063
+ "One-shot migration: realloc ValidatorInfoAccounts for new fields (mev + _reserved)",
2064
+ "Pass validator_info PDAs via remaining_accounts"
2065
+ ],
2066
+ "discriminator": [
2067
+ 250,
2068
+ 77,
2069
+ 53,
2070
+ 116,
2071
+ 38,
2072
+ 22,
2073
+ 12,
2074
+ 100
2075
+ ],
2076
+ "accounts": [
2077
+ {
2078
+ "name": "global_config"
2079
+ },
2080
+ {
2081
+ "name": "admin",
2082
+ "writable": true,
2083
+ "signer": true
2084
+ },
2085
+ {
2086
+ "name": "system_program"
2087
+ }
2088
+ ],
2089
+ "args": []
2090
+ },
1985
2091
  {
1986
2092
  "name": "process_graveyard_validators_batch",
1987
2093
  "docs": [
@@ -3436,6 +3542,20 @@
3436
3542
  },
3437
3543
  {
3438
3544
  "name": "stake_history"
3545
+ },
3546
+ {
3547
+ "name": "vault",
3548
+ "writable": true
3549
+ },
3550
+ {
3551
+ "name": "reserve_pool",
3552
+ "writable": true
3553
+ },
3554
+ {
3555
+ "name": "stake_program"
3556
+ },
3557
+ {
3558
+ "name": "clock"
3439
3559
  }
3440
3560
  ],
3441
3561
  "args": []
@@ -4507,12 +4627,61 @@
4507
4627
  ],
4508
4628
  "type": "u64"
4509
4629
  },
4630
+ {
4631
+ "name": "mev_claims_next_index",
4632
+ "docs": [
4633
+ "Next active_list index to process for MEV tip claims"
4634
+ ],
4635
+ "type": "u16"
4636
+ },
4637
+ {
4638
+ "name": "temp_total_mev_reward",
4639
+ "docs": [
4640
+ "Temporary accumulator for MEV rewards across batches"
4641
+ ],
4642
+ "type": "u64"
4643
+ },
4644
+ {
4645
+ "name": "temp_total_outstanding_amount_to_unstake",
4646
+ "docs": [
4647
+ "Temporary accumulator for sum of validators' amount_to_unstake across batches"
4648
+ ],
4649
+ "type": "u64"
4650
+ },
4651
+ {
4652
+ "name": "validators_sync_started_epoch",
4653
+ "docs": [
4654
+ "Owns validators_sync_processed_this_epoch."
4655
+ ],
4656
+ "type": "u16"
4657
+ },
4658
+ {
4659
+ "name": "leaderboard_scores_started_epoch",
4660
+ "docs": [
4661
+ "Owns leaderboard_scores_next_index."
4662
+ ],
4663
+ "type": "u16"
4664
+ },
4665
+ {
4666
+ "name": "graveyard_cleanup_started_epoch",
4667
+ "docs": [
4668
+ "Owns graveyard_cleanup_next_index."
4669
+ ],
4670
+ "type": "u16"
4671
+ },
4672
+ {
4673
+ "name": "addition_started_epoch",
4674
+ "docs": [
4675
+ "Owns addition_next_rank + addition_target_rank."
4676
+ ],
4677
+ "type": "u16"
4678
+ },
4510
4679
  {
4511
4680
  "name": "_reserved",
4512
4681
  "type": {
4513
4682
  "array": [
4514
4683
  "u8",
4515
- 23
4684
+ 64
4516
4685
  ]
4517
4686
  }
4518
4687
  }
@@ -4856,7 +5025,9 @@
4856
5025
  {
4857
5026
  "name": "transient_threshold",
4858
5027
  "docs": [
4859
- "Minimum transient stake to include in effective stake calculations"
5028
+ "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.",
5029
+ "Rebalance now counts all transient stake on both sides of the delta equation,",
5030
+ "so the per-validator threshold gate was removed."
4860
5031
  ],
4861
5032
  "type": "u64"
4862
5033
  },
@@ -5002,6 +5173,15 @@
5002
5173
  1
5003
5174
  ]
5004
5175
  }
5176
+ },
5177
+ {
5178
+ "name": "_reserved_trailing",
5179
+ "type": {
5180
+ "array": [
5181
+ "u8",
5182
+ 32
5183
+ ]
5184
+ }
5005
5185
  }
5006
5186
  ]
5007
5187
  }
@@ -5222,16 +5402,32 @@
5222
5402
  "type": "u8"
5223
5403
  },
5224
5404
  {
5225
- "name": "_padding",
5405
+ "name": "_align",
5226
5406
  "docs": [
5227
- "Reserved space for future upgrades"
5407
+ "Alignment byte (keeps u16 fields below properly aligned)"
5228
5408
  ],
5229
- "type": {
5230
- "array": [
5231
- "u8",
5232
- 5
5233
- ]
5234
- }
5409
+ "type": "u8"
5410
+ },
5411
+ {
5412
+ "name": "crank_next_index",
5413
+ "docs": [
5414
+ "Next validator index to process during crank_update_scores"
5415
+ ],
5416
+ "type": "u16"
5417
+ },
5418
+ {
5419
+ "name": "last_crank_epoch",
5420
+ "docs": [
5421
+ "Last epoch when crank_update_scores completed all validators"
5422
+ ],
5423
+ "type": "u16"
5424
+ },
5425
+ {
5426
+ "name": "crank_started_epoch",
5427
+ "docs": [
5428
+ "Epoch when start_crank was called (signals an active crank cycle)"
5429
+ ],
5430
+ "type": "u16"
5235
5431
  }
5236
5432
  ]
5237
5433
  }
@@ -5891,9 +6087,13 @@
5891
6087
  "type": "bool"
5892
6088
  },
5893
6089
  {
5894
- "name": "addition_next_rank",
6090
+ "name": "unstake_allocation_started_epoch",
5895
6091
  "docs": [
5896
- "DEPRECATED see BatchOrchestrator.addition_next_rank. Always 0."
6092
+ "Epoch in which the current unstake allocation cycle was started.",
6093
+ "Used to detect stale cycles that span epoch boundaries — if the epoch",
6094
+ "has advanced, the cycle is reset and restarted to avoid resuming",
6095
+ "against a mutated validator active list.",
6096
+ "(Repurposed from the deprecated addition_next_rank field — verified 0 on the mainnet.)"
5897
6097
  ],
5898
6098
  "type": "u16"
5899
6099
  },
@@ -5994,6 +6194,34 @@
5994
6194
  {
5995
6195
  "name": "bump",
5996
6196
  "type": "u8"
6197
+ },
6198
+ {
6199
+ "name": "mev_reward",
6200
+ "docs": [
6201
+ "MEV rewards swept from main stake accounts this epoch (accumulated, reset after pay cycle)"
6202
+ ],
6203
+ "type": "u64"
6204
+ },
6205
+ {
6206
+ "name": "total_outstanding_amount_to_unstake",
6207
+ "docs": [
6208
+ "WNS-16: total amount_to_unstake across all validators at last metrics refresh.",
6209
+ "Represents allocated-but-not-yet-deactivated unstake obligations.",
6210
+ "Subtracted from unstakeable_stake in admission control to prevent double-promising."
6211
+ ],
6212
+ "type": "u64"
6213
+ },
6214
+ {
6215
+ "name": "_reserved",
6216
+ "docs": [
6217
+ "Reserved space for future use"
6218
+ ],
6219
+ "type": {
6220
+ "array": [
6221
+ "u8",
6222
+ 24
6223
+ ]
6224
+ }
5997
6225
  }
5998
6226
  ]
5999
6227
  }
@@ -6320,6 +6548,25 @@
6320
6548
  {
6321
6549
  "name": "state_transition_trigger_stake_amount",
6322
6550
  "type": "u64"
6551
+ },
6552
+ {
6553
+ "name": "mev_earned",
6554
+ "docs": [
6555
+ "MEV reward swept for this validator in the current epoch"
6556
+ ],
6557
+ "type": "u64"
6558
+ },
6559
+ {
6560
+ "name": "_reserved",
6561
+ "docs": [
6562
+ "Reserved space for future use"
6563
+ ],
6564
+ "type": {
6565
+ "array": [
6566
+ "u8",
6567
+ 24
6568
+ ]
6569
+ }
6323
6570
  }
6324
6571
  ]
6325
6572
  }
@@ -325,7 +325,9 @@
325
325
  {
326
326
  "name": "transient_threshold",
327
327
  "docs": [
328
- "Minimum transient stake to include in effective stake calculations"
328
+ "DEPRECATED (WNS-33): no longer read. Kept for account layout stability.",
329
+ "Rebalance now counts all transient stake on both sides of the delta equation,",
330
+ "so the per-validator threshold gate was removed."
329
331
  ],
330
332
  "type": "u64"
331
333
  },
@@ -471,6 +473,15 @@
471
473
  1
472
474
  ]
473
475
  }
476
+ },
477
+ {
478
+ "name": "_reserved_trailing",
479
+ "type": {
480
+ "array": [
481
+ "u8",
482
+ 32
483
+ ]
484
+ }
474
485
  }
475
486
  ]
476
487
  }
@@ -7,6 +7,26 @@
7
7
  "description": "Created with Anchor"
8
8
  },
9
9
  "instructions": [
10
+ {
11
+ "name": "crank_update_scores",
12
+ "discriminator": [
13
+ 163,
14
+ 247,
15
+ 66,
16
+ 109,
17
+ 22,
18
+ 206,
19
+ 61,
20
+ 95
21
+ ],
22
+ "accounts": [
23
+ {
24
+ "name": "leaderboard_state",
25
+ "writable": true
26
+ }
27
+ ],
28
+ "args": []
29
+ },
10
30
  {
11
31
  "name": "initialize_leaderboard",
12
32
  "discriminator": [
@@ -36,27 +56,27 @@
36
56
  "args": []
37
57
  },
38
58
  {
39
- "name": "realloc_leaderboard",
59
+ "name": "migrate_v1_4",
40
60
  "discriminator": [
41
- 2,
42
- 70,
43
- 106,
44
- 94,
45
- 81,
46
- 225,
47
- 113,
48
- 152
61
+ 41,
62
+ 152,
63
+ 69,
64
+ 58,
65
+ 215,
66
+ 119,
67
+ 255,
68
+ 189
49
69
  ],
50
70
  "accounts": [
51
71
  {
52
- "name": "leaderboard_state",
53
- "writable": true
54
- },
55
- {
56
- "name": "payer",
72
+ "name": "authority",
57
73
  "writable": true,
58
74
  "signer": true
59
75
  },
76
+ {
77
+ "name": "leaderboard_state",
78
+ "writable": true
79
+ },
60
80
  {
61
81
  "name": "system_program"
62
82
  }
@@ -64,29 +84,26 @@
64
84
  "args": []
65
85
  },
66
86
  {
67
- "name": "update_commission",
87
+ "name": "realloc_leaderboard",
68
88
  "discriminator": [
69
89
  2,
70
- 202,
71
- 72,
72
- 156,
73
- 19,
74
- 253,
75
- 91,
76
- 174
90
+ 70,
91
+ 106,
92
+ 94,
93
+ 81,
94
+ 225,
95
+ 113,
96
+ 152
77
97
  ],
78
98
  "accounts": [
79
99
  {
80
- "name": "registrant",
81
- "writable": true,
82
- "signer": true
83
- },
84
- {
85
- "name": "vote_account"
100
+ "name": "leaderboard_state",
101
+ "writable": true
86
102
  },
87
103
  {
88
- "name": "validator_record",
89
- "writable": true
104
+ "name": "payer",
105
+ "writable": true,
106
+ "signer": true
90
107
  },
91
108
  {
92
109
  "name": "system_program"
@@ -95,28 +112,25 @@
95
112
  "args": []
96
113
  },
97
114
  {
98
- "name": "update_mev_commission",
115
+ "name": "start_crank",
99
116
  "discriminator": [
100
- 107,
101
- 65,
102
- 238,
103
- 108,
104
- 183,
105
- 47,
106
- 236,
107
- 203
117
+ 31,
118
+ 83,
119
+ 66,
120
+ 14,
121
+ 249,
122
+ 131,
123
+ 221,
124
+ 67
108
125
  ],
109
126
  "accounts": [
110
127
  {
111
- "name": "signer",
128
+ "name": "cranker",
112
129
  "signer": true
113
130
  },
114
131
  {
115
- "name": "validator_record",
132
+ "name": "leaderboard_state",
116
133
  "writable": true
117
- },
118
- {
119
- "name": "tip_distribution_account"
120
134
  }
121
135
  ],
122
136
  "args": []
@@ -140,7 +154,10 @@
140
154
  "signer": true
141
155
  },
142
156
  {
143
- "name": "vote_account"
157
+ "name": "vote_account",
158
+ "docs": [
159
+ "If no longer owned by the vote program (closed/reclaimed), score is set to 0."
160
+ ]
144
161
  },
145
162
  {
146
163
  "name": "validator_record",
@@ -154,16 +171,7 @@
154
171
  "name": "system_program"
155
172
  }
156
173
  ],
157
- "args": [
158
- {
159
- "name": "vpp",
160
- "type": "u8"
161
- },
162
- {
163
- "name": "proposed_rank",
164
- "type": "u16"
165
- }
166
- ]
174
+ "args": []
167
175
  }
168
176
  ],
169
177
  "accounts": [
@@ -410,16 +418,32 @@
410
418
  "type": "u8"
411
419
  },
412
420
  {
413
- "name": "_padding",
421
+ "name": "_align",
414
422
  "docs": [
415
- "Reserved space for future upgrades"
423
+ "Alignment byte (keeps u16 fields below properly aligned)"
416
424
  ],
417
- "type": {
418
- "array": [
419
- "u8",
420
- 5
421
- ]
422
- }
425
+ "type": "u8"
426
+ },
427
+ {
428
+ "name": "crank_next_index",
429
+ "docs": [
430
+ "Next validator index to process during crank_update_scores"
431
+ ],
432
+ "type": "u16"
433
+ },
434
+ {
435
+ "name": "last_crank_epoch",
436
+ "docs": [
437
+ "Last epoch when crank_update_scores completed all validators"
438
+ ],
439
+ "type": "u16"
440
+ },
441
+ {
442
+ "name": "crank_started_epoch",
443
+ "docs": [
444
+ "Epoch when start_crank was called (signals an active crank cycle)"
445
+ ],
446
+ "type": "u16"
423
447
  }
424
448
  ]
425
449
  }
@@ -530,15 +554,13 @@
530
554
  {
531
555
  "name": "mev_commission",
532
556
  "docs": [
533
- "Current MEV commission in basis points"
557
+ "DEPRECATED: MEV commission fields are no longer written or read by any instruction.",
558
+ "Retained to preserve account layout (removing would require migration)."
534
559
  ],
535
560
  "type": "u16"
536
561
  },
537
562
  {
538
563
  "name": "mev_commission_history",
539
- "docs": [
540
- "Circular buffer of past 10 MEV commission values"
541
- ],
542
564
  "type": {
543
565
  "array": [
544
566
  "u16",
@@ -548,16 +570,10 @@
548
570
  },
549
571
  {
550
572
  "name": "mev_commission_index",
551
- "docs": [
552
- "Current index in mev_commission_history circular buffer (0-9)"
553
- ],
554
573
  "type": "u8"
555
574
  },
556
575
  {
557
576
  "name": "last_mev_commission_update",
558
- "docs": [
559
- "Last epoch when MEV commission was updated"
560
- ],
561
577
  "type": "u64"
562
578
  },
563
579
  {