@wireio/stake 0.1.0 → 0.1.2
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/README.md +57 -0
- package/lib/stake.browser.js +11836 -4103
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +374 -556
- package/lib/stake.js +12089 -4303
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +11836 -4103
- package/lib/stake.m.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +1153 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.json +172 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.json +39 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.json +64 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthBurn.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthBurn.json +24 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthMint.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthMint.json +35 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.json +213 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.json +138 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +70 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +64 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.json +10 -0
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20.json +749 -0
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20Pausable.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20Pausable.json +812 -0
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +10 -0
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +10 -0
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +225 -0
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.json +10 -0
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.json +10 -0
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json +813 -0
- package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +651 -0
- package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.json +1110 -0
- package/src/assets/ethereum/ABI/liqEth/liqEthBurn.sol/LiqEthBurn.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/liqEthBurn.sol/LiqEthBurn.json +391 -0
- package/src/assets/ethereum/ABI/liqEth/liqEthMint.sol/LiqEthMint.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/liqEthMint.sol/LiqEthMint.json +402 -0
- package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +1225 -0
- package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +927 -0
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.json +10 -0
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +4 -0
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +447 -0
- package/src/assets/solana/idl/liqsol_core.json +4239 -0
- package/src/assets/solana/idl/liqsol_token.json +183 -0
- package/src/assets/solana/idl/validator_leaderboard.json +270 -265
- package/src/assets/solana/types/liqsol_core.ts +4245 -0
- package/src/assets/solana/types/liqsol_token.ts +189 -0
- package/src/assets/solana/types/validator_leaderboard.ts +270 -265
- package/src/index.ts +1 -3
- package/src/networks/ethereum/contract.ts +101 -36
- package/src/networks/ethereum/ethereum.ts +141 -45
- package/src/networks/ethereum/types.ts +30 -2
- package/src/networks/solana/clients/deposit.client.ts +71 -109
- package/src/networks/solana/clients/distribution.client.ts +256 -383
- package/src/networks/solana/clients/leaderboard.client.ts +38 -133
- package/src/networks/solana/constants.ts +214 -130
- package/src/networks/solana/program.ts +25 -38
- package/src/networks/solana/solana.ts +120 -105
- package/src/networks/solana/types.ts +37 -47
- package/src/networks/solana/utils.ts +551 -0
- package/src/scripts/tsconfig.json +17 -0
- package/src/staker/staker.ts +10 -6
- package/src/staker/types.ts +14 -9
- package/src/assets/solana/idl/deposit.json +0 -296
- package/src/assets/solana/idl/distribution.json +0 -768
- package/src/assets/solana/idl/liq_sol_token.json +0 -298
- package/src/assets/solana/idl/mint_helper.json +0 -110
- package/src/assets/solana/idl/read_tracked_balance.json +0 -140
- package/src/assets/solana/idl/stake_controller.json +0 -2149
- package/src/assets/solana/idl/treasury.json +0 -110
- package/src/assets/solana/idl/validator_registry.json +0 -487
- package/src/assets/solana/idl/yield_oracle.json +0 -32
- package/src/assets/solana/types/deposit.ts +0 -302
- package/src/assets/solana/types/distribution.ts +0 -774
- package/src/assets/solana/types/liq_sol_token.ts +0 -304
- package/src/assets/solana/types/mint_helper.ts +0 -116
- package/src/assets/solana/types/read_tracked_balance.ts +0 -146
- package/src/assets/solana/types/stake_controller.ts +0 -2155
- package/src/assets/solana/types/stake_registry.ts +0 -441
- package/src/assets/solana/types/treasury.ts +0 -116
- package/src/assets/solana/types/validator_registry.ts +0 -493
- package/src/assets/solana/types/yield_oracle.ts +0 -38
- package/src/common/utils.ts +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"address": "
|
|
2
|
+
"address": "5Nf6jL5B2qkMbnLoN3RTT1sKcBKrrsRnovTBDZXcQnfo",
|
|
3
3
|
"metadata": {
|
|
4
4
|
"name": "validator_leaderboard",
|
|
5
5
|
"version": "0.1.0",
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
},
|
|
9
9
|
"instructions": [
|
|
10
10
|
{
|
|
11
|
-
"name": "
|
|
11
|
+
"name": "initialize_leaderboard",
|
|
12
12
|
"discriminator": [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
47,
|
|
14
|
+
23,
|
|
15
|
+
34,
|
|
16
|
+
39,
|
|
17
|
+
46,
|
|
18
|
+
108,
|
|
19
|
+
91,
|
|
20
|
+
176
|
|
21
21
|
],
|
|
22
22
|
"accounts": [
|
|
23
23
|
{
|
|
@@ -26,40 +26,39 @@
|
|
|
26
26
|
"signer": true
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
"name": "
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
"name": "leaderboard_state",
|
|
30
|
+
"writable": true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "system_program"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"args": []
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "realloc_leaderboard",
|
|
40
|
+
"discriminator": [
|
|
41
|
+
2,
|
|
42
|
+
70,
|
|
43
|
+
106,
|
|
44
|
+
94,
|
|
45
|
+
81,
|
|
46
|
+
225,
|
|
47
|
+
113,
|
|
48
|
+
152
|
|
49
|
+
],
|
|
50
|
+
"accounts": [
|
|
51
|
+
{
|
|
52
|
+
"name": "leaderboard_state",
|
|
53
|
+
"writable": true
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "payer",
|
|
33
57
|
"writable": true,
|
|
34
|
-
"
|
|
35
|
-
"seeds": [
|
|
36
|
-
{
|
|
37
|
-
"kind": "const",
|
|
38
|
-
"value": [
|
|
39
|
-
108,
|
|
40
|
-
101,
|
|
41
|
-
97,
|
|
42
|
-
100,
|
|
43
|
-
101,
|
|
44
|
-
114,
|
|
45
|
-
98,
|
|
46
|
-
111,
|
|
47
|
-
97,
|
|
48
|
-
114,
|
|
49
|
-
100,
|
|
50
|
-
95,
|
|
51
|
-
104,
|
|
52
|
-
101,
|
|
53
|
-
97,
|
|
54
|
-
100
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
58
|
+
"signer": true
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
"name": "system_program"
|
|
62
|
-
"address": "11111111111111111111111111111111"
|
|
61
|
+
"name": "system_program"
|
|
63
62
|
}
|
|
64
63
|
],
|
|
65
64
|
"args": []
|
|
@@ -87,124 +86,40 @@
|
|
|
87
86
|
},
|
|
88
87
|
{
|
|
89
88
|
"name": "validator_record",
|
|
90
|
-
"writable": true
|
|
91
|
-
"pda": {
|
|
92
|
-
"seeds": [
|
|
93
|
-
{
|
|
94
|
-
"kind": "const",
|
|
95
|
-
"value": [
|
|
96
|
-
118,
|
|
97
|
-
97,
|
|
98
|
-
108,
|
|
99
|
-
105,
|
|
100
|
-
100,
|
|
101
|
-
97,
|
|
102
|
-
116,
|
|
103
|
-
111,
|
|
104
|
-
114
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"kind": "account",
|
|
109
|
-
"path": "vote_account"
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
|
89
|
+
"writable": true
|
|
113
90
|
},
|
|
114
91
|
{
|
|
115
|
-
"name": "system_program"
|
|
116
|
-
"address": "11111111111111111111111111111111"
|
|
92
|
+
"name": "system_program"
|
|
117
93
|
}
|
|
118
94
|
],
|
|
119
95
|
"args": []
|
|
120
96
|
},
|
|
121
97
|
{
|
|
122
|
-
"name": "
|
|
98
|
+
"name": "update_mev_commission",
|
|
123
99
|
"discriminator": [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
100
|
+
107,
|
|
101
|
+
65,
|
|
102
|
+
238,
|
|
103
|
+
108,
|
|
104
|
+
183,
|
|
105
|
+
47,
|
|
106
|
+
236,
|
|
107
|
+
203
|
|
132
108
|
],
|
|
133
109
|
"accounts": [
|
|
134
110
|
{
|
|
135
|
-
"name": "
|
|
136
|
-
"writable": true,
|
|
111
|
+
"name": "signer",
|
|
137
112
|
"signer": true
|
|
138
113
|
},
|
|
139
114
|
{
|
|
140
|
-
"name": "
|
|
141
|
-
"writable": true
|
|
142
|
-
"pda": {
|
|
143
|
-
"seeds": [
|
|
144
|
-
{
|
|
145
|
-
"kind": "const",
|
|
146
|
-
"value": [
|
|
147
|
-
116,
|
|
148
|
-
111,
|
|
149
|
-
112,
|
|
150
|
-
95,
|
|
151
|
-
49,
|
|
152
|
-
48,
|
|
153
|
-
95,
|
|
154
|
-
99,
|
|
155
|
-
97,
|
|
156
|
-
99,
|
|
157
|
-
104,
|
|
158
|
-
101
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"name": "leaderboard_head",
|
|
166
|
-
"pda": {
|
|
167
|
-
"seeds": [
|
|
168
|
-
{
|
|
169
|
-
"kind": "const",
|
|
170
|
-
"value": [
|
|
171
|
-
108,
|
|
172
|
-
101,
|
|
173
|
-
97,
|
|
174
|
-
100,
|
|
175
|
-
101,
|
|
176
|
-
114,
|
|
177
|
-
98,
|
|
178
|
-
111,
|
|
179
|
-
97,
|
|
180
|
-
114,
|
|
181
|
-
100,
|
|
182
|
-
95,
|
|
183
|
-
104,
|
|
184
|
-
101,
|
|
185
|
-
97,
|
|
186
|
-
100
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
}
|
|
115
|
+
"name": "validator_record",
|
|
116
|
+
"writable": true
|
|
191
117
|
},
|
|
192
118
|
{
|
|
193
|
-
"name": "
|
|
194
|
-
"address": "11111111111111111111111111111111"
|
|
119
|
+
"name": "tip_distribution_account"
|
|
195
120
|
}
|
|
196
121
|
],
|
|
197
|
-
"args": [
|
|
198
|
-
{
|
|
199
|
-
"name": "top_10",
|
|
200
|
-
"type": {
|
|
201
|
-
"array": [
|
|
202
|
-
"pubkey",
|
|
203
|
-
10
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
]
|
|
122
|
+
"args": []
|
|
208
123
|
},
|
|
209
124
|
{
|
|
210
125
|
"name": "update_validator",
|
|
@@ -229,117 +144,40 @@
|
|
|
229
144
|
},
|
|
230
145
|
{
|
|
231
146
|
"name": "validator_record",
|
|
232
|
-
"writable": true
|
|
233
|
-
"pda": {
|
|
234
|
-
"seeds": [
|
|
235
|
-
{
|
|
236
|
-
"kind": "const",
|
|
237
|
-
"value": [
|
|
238
|
-
118,
|
|
239
|
-
97,
|
|
240
|
-
108,
|
|
241
|
-
105,
|
|
242
|
-
100,
|
|
243
|
-
97,
|
|
244
|
-
116,
|
|
245
|
-
111,
|
|
246
|
-
114
|
|
247
|
-
]
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"kind": "account",
|
|
251
|
-
"path": "vote_account"
|
|
252
|
-
}
|
|
253
|
-
]
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"name": "leaderboard_head",
|
|
258
|
-
"writable": true,
|
|
259
|
-
"pda": {
|
|
260
|
-
"seeds": [
|
|
261
|
-
{
|
|
262
|
-
"kind": "const",
|
|
263
|
-
"value": [
|
|
264
|
-
108,
|
|
265
|
-
101,
|
|
266
|
-
97,
|
|
267
|
-
100,
|
|
268
|
-
101,
|
|
269
|
-
114,
|
|
270
|
-
98,
|
|
271
|
-
111,
|
|
272
|
-
97,
|
|
273
|
-
114,
|
|
274
|
-
100,
|
|
275
|
-
95,
|
|
276
|
-
104,
|
|
277
|
-
101,
|
|
278
|
-
97,
|
|
279
|
-
100
|
|
280
|
-
]
|
|
281
|
-
}
|
|
282
|
-
]
|
|
283
|
-
}
|
|
147
|
+
"writable": true
|
|
284
148
|
},
|
|
285
149
|
{
|
|
286
|
-
"name": "
|
|
287
|
-
"writable": true
|
|
288
|
-
"optional": true
|
|
150
|
+
"name": "leaderboard_state",
|
|
151
|
+
"writable": true
|
|
289
152
|
},
|
|
290
153
|
{
|
|
291
|
-
"name": "
|
|
292
|
-
"writable": true,
|
|
293
|
-
"optional": true
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"name": "current_prev",
|
|
297
|
-
"writable": true,
|
|
298
|
-
"optional": true
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
"name": "current_next",
|
|
302
|
-
"writable": true,
|
|
303
|
-
"optional": true
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"name": "system_program",
|
|
307
|
-
"address": "11111111111111111111111111111111"
|
|
154
|
+
"name": "system_program"
|
|
308
155
|
}
|
|
309
156
|
],
|
|
310
157
|
"args": [
|
|
311
158
|
{
|
|
312
159
|
"name": "vpp",
|
|
313
160
|
"type": "u64"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "proposed_rank",
|
|
164
|
+
"type": "u16"
|
|
314
165
|
}
|
|
315
166
|
]
|
|
316
167
|
}
|
|
317
168
|
],
|
|
318
169
|
"accounts": [
|
|
319
170
|
{
|
|
320
|
-
"name": "
|
|
171
|
+
"name": "LeaderboardState",
|
|
321
172
|
"discriminator": [
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
41,
|
|
327
|
-
114,
|
|
328
|
-
23,
|
|
329
|
-
157
|
|
330
|
-
]
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
"name": "Top10Cache",
|
|
334
|
-
"discriminator": [
|
|
335
|
-
112,
|
|
336
|
-
78,
|
|
173
|
+
211,
|
|
174
|
+
181,
|
|
175
|
+
29,
|
|
176
|
+
120,
|
|
337
177
|
189,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
15,
|
|
342
|
-
81
|
|
178
|
+
4,
|
|
179
|
+
106,
|
|
180
|
+
111
|
|
343
181
|
]
|
|
344
182
|
},
|
|
345
183
|
{
|
|
@@ -446,71 +284,207 @@
|
|
|
446
284
|
"code": 6017,
|
|
447
285
|
"name": "CommissionNotUpdated",
|
|
448
286
|
"msg": "Commission must be updated for current epoch before updating validator"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"code": 6018,
|
|
290
|
+
"name": "MevCommissionNotUpdated",
|
|
291
|
+
"msg": "MEV commission must be updated for current epoch before updating validator"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"code": 6019,
|
|
295
|
+
"name": "InvalidCurrentNeighbor",
|
|
296
|
+
"msg": "Current neighbor account doesn't match validator's stored links"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"code": 6020,
|
|
300
|
+
"name": "NonAdjacentInsertionPosition",
|
|
301
|
+
"msg": "Insertion position accounts are not actually adjacent in leaderboard"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"code": 6021,
|
|
305
|
+
"name": "StaleAccountReference",
|
|
306
|
+
"msg": "Account reference is outdated due to concurrent update"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"code": 6022,
|
|
310
|
+
"name": "InvalidStakeAmount",
|
|
311
|
+
"msg": "Invalid stake amount - exceeds maximum allowed"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"code": 6023,
|
|
315
|
+
"name": "InvalidTipDistributionAccount",
|
|
316
|
+
"msg": "Invalid Tip Distribution Account provided"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"code": 6024,
|
|
320
|
+
"name": "InvalidRankPosition",
|
|
321
|
+
"msg": "Proposed rank position violates sorted ordering"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"code": 6025,
|
|
325
|
+
"name": "LeaderboardFull",
|
|
326
|
+
"msg": "Leaderboard is full - cannot add more validators"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"code": 6026,
|
|
330
|
+
"name": "ValidatorNotInRankings",
|
|
331
|
+
"msg": "Validator not found in rankings"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"code": 6027,
|
|
335
|
+
"name": "ArithmeticOverflow",
|
|
336
|
+
"msg": "Arithmetic overflow"
|
|
449
337
|
}
|
|
450
338
|
],
|
|
451
339
|
"types": [
|
|
452
340
|
{
|
|
453
|
-
"name": "
|
|
341
|
+
"name": "LeaderboardState",
|
|
454
342
|
"docs": [
|
|
455
|
-
"
|
|
343
|
+
"Central leaderboard state using parallel arrays for efficient ranking and CPI access",
|
|
344
|
+
"Stores VPP scores and sorted rankings for up to 1024 validators",
|
|
345
|
+
"Uses zero-copy for efficient access from other programs via CPI"
|
|
456
346
|
],
|
|
347
|
+
"serialization": "bytemuck",
|
|
348
|
+
"repr": {
|
|
349
|
+
"kind": "c"
|
|
350
|
+
},
|
|
457
351
|
"type": {
|
|
458
352
|
"kind": "struct",
|
|
459
353
|
"fields": [
|
|
460
354
|
{
|
|
461
|
-
"name": "
|
|
462
|
-
"
|
|
355
|
+
"name": "scores",
|
|
356
|
+
"docs": [
|
|
357
|
+
"VPP scores indexed by registry_index",
|
|
358
|
+
"registry_index is assigned on first validator registration and never changes"
|
|
359
|
+
],
|
|
360
|
+
"type": {
|
|
361
|
+
"array": [
|
|
362
|
+
"u64",
|
|
363
|
+
1024
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "sorted_indices",
|
|
369
|
+
"docs": [
|
|
370
|
+
"Validator indices sorted by VPP score descending",
|
|
371
|
+
"sorted_indices[0] = registry_index of highest VPP validator",
|
|
372
|
+
"sorted_indices[1] = registry_index of 2nd highest VPP validator, etc."
|
|
373
|
+
],
|
|
374
|
+
"type": {
|
|
375
|
+
"array": [
|
|
376
|
+
"u16",
|
|
377
|
+
1024
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "vote_accounts",
|
|
383
|
+
"docs": [
|
|
384
|
+
"Vote account pubkeys indexed by registry_index",
|
|
385
|
+
"Allows CPI callers to get vote accounts for top N validators"
|
|
386
|
+
],
|
|
387
|
+
"type": {
|
|
388
|
+
"array": [
|
|
389
|
+
{
|
|
390
|
+
"defined": {
|
|
391
|
+
"name": "PubkeyBytes"
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
1024
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"name": "num_validators",
|
|
400
|
+
"docs": [
|
|
401
|
+
"Number of active validators currently in the leaderboard"
|
|
402
|
+
],
|
|
403
|
+
"type": "u16"
|
|
463
404
|
},
|
|
464
405
|
{
|
|
465
406
|
"name": "bump",
|
|
407
|
+
"docs": [
|
|
408
|
+
"PDA bump seed"
|
|
409
|
+
],
|
|
466
410
|
"type": "u8"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "_padding",
|
|
414
|
+
"docs": [
|
|
415
|
+
"Reserved space for future upgrades"
|
|
416
|
+
],
|
|
417
|
+
"type": {
|
|
418
|
+
"array": [
|
|
419
|
+
"u8",
|
|
420
|
+
5
|
|
421
|
+
]
|
|
422
|
+
}
|
|
467
423
|
}
|
|
468
424
|
]
|
|
469
425
|
}
|
|
470
426
|
},
|
|
471
427
|
{
|
|
472
|
-
"name": "
|
|
428
|
+
"name": "PubkeyBytes",
|
|
473
429
|
"docs": [
|
|
474
|
-
"
|
|
430
|
+
"Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.",
|
|
431
|
+
"Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`."
|
|
475
432
|
],
|
|
433
|
+
"serialization": "bytemuck",
|
|
434
|
+
"repr": {
|
|
435
|
+
"kind": "transparent"
|
|
436
|
+
},
|
|
476
437
|
"type": {
|
|
477
438
|
"kind": "struct",
|
|
478
439
|
"fields": [
|
|
479
440
|
{
|
|
480
|
-
"name": "
|
|
441
|
+
"name": "bytes",
|
|
481
442
|
"type": {
|
|
482
443
|
"array": [
|
|
483
|
-
"
|
|
484
|
-
|
|
444
|
+
"u8",
|
|
445
|
+
32
|
|
485
446
|
]
|
|
486
447
|
}
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
"name": "last_updated_slot",
|
|
490
|
-
"type": "u64"
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
"name": "bump",
|
|
494
|
-
"type": "u8"
|
|
495
448
|
}
|
|
496
449
|
]
|
|
497
450
|
}
|
|
498
451
|
},
|
|
499
452
|
{
|
|
500
453
|
"name": "ValidatorRecord",
|
|
454
|
+
"docs": [
|
|
455
|
+
"Per-validator record account storing commission data and metadata"
|
|
456
|
+
],
|
|
501
457
|
"type": {
|
|
502
458
|
"kind": "struct",
|
|
503
459
|
"fields": [
|
|
504
460
|
{
|
|
505
461
|
"name": "vote_account",
|
|
462
|
+
"docs": [
|
|
463
|
+
"The validator's vote account pubkey"
|
|
464
|
+
],
|
|
506
465
|
"type": "pubkey"
|
|
507
466
|
},
|
|
467
|
+
{
|
|
468
|
+
"name": "registry_index",
|
|
469
|
+
"docs": [
|
|
470
|
+
"Immutable index into LeaderboardState arrays",
|
|
471
|
+
"Assigned on first registration, never changes"
|
|
472
|
+
],
|
|
473
|
+
"type": "u16"
|
|
474
|
+
},
|
|
508
475
|
{
|
|
509
476
|
"name": "credits_observed",
|
|
477
|
+
"docs": [
|
|
478
|
+
"Current cumulative credits from vote account"
|
|
479
|
+
],
|
|
510
480
|
"type": "u64"
|
|
511
481
|
},
|
|
512
482
|
{
|
|
513
483
|
"name": "commission_history",
|
|
484
|
+
"docs": [
|
|
485
|
+
"Circular buffer of past 10 commission values (0-100)",
|
|
486
|
+
"Used to penalize validators who increase commission"
|
|
487
|
+
],
|
|
514
488
|
"type": {
|
|
515
489
|
"array": [
|
|
516
490
|
"u8",
|
|
@@ -520,46 +494,77 @@
|
|
|
520
494
|
},
|
|
521
495
|
{
|
|
522
496
|
"name": "commission_index",
|
|
497
|
+
"docs": [
|
|
498
|
+
"Current index in commission_history circular buffer (0-9)"
|
|
499
|
+
],
|
|
523
500
|
"type": "u8"
|
|
524
501
|
},
|
|
525
502
|
{
|
|
526
503
|
"name": "last_commission_update",
|
|
504
|
+
"docs": [
|
|
505
|
+
"Last epoch when commission was updated"
|
|
506
|
+
],
|
|
527
507
|
"type": "u64"
|
|
528
508
|
},
|
|
529
509
|
{
|
|
530
510
|
"name": "epoch",
|
|
511
|
+
"docs": [
|
|
512
|
+
"Last epoch this validator was updated"
|
|
513
|
+
],
|
|
531
514
|
"type": "u64"
|
|
532
515
|
},
|
|
533
516
|
{
|
|
534
517
|
"name": "slot",
|
|
518
|
+
"docs": [
|
|
519
|
+
"Last slot this validator was updated"
|
|
520
|
+
],
|
|
535
521
|
"type": "u64"
|
|
536
522
|
},
|
|
537
523
|
{
|
|
538
|
-
"name": "
|
|
539
|
-
"
|
|
524
|
+
"name": "wire_operator",
|
|
525
|
+
"docs": [
|
|
526
|
+
"Whether this validator is a Wire operator (5% bonus)"
|
|
527
|
+
],
|
|
528
|
+
"type": "bool"
|
|
540
529
|
},
|
|
541
530
|
{
|
|
542
|
-
"name": "
|
|
543
|
-
"
|
|
531
|
+
"name": "mev_commission",
|
|
532
|
+
"docs": [
|
|
533
|
+
"Current MEV commission in basis points"
|
|
534
|
+
],
|
|
535
|
+
"type": "u16"
|
|
544
536
|
},
|
|
545
537
|
{
|
|
546
|
-
"name": "
|
|
547
|
-
"
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
"
|
|
551
|
-
|
|
538
|
+
"name": "mev_commission_history",
|
|
539
|
+
"docs": [
|
|
540
|
+
"Circular buffer of past 10 MEV commission values"
|
|
541
|
+
],
|
|
542
|
+
"type": {
|
|
543
|
+
"array": [
|
|
544
|
+
"u16",
|
|
545
|
+
10
|
|
546
|
+
]
|
|
547
|
+
}
|
|
552
548
|
},
|
|
553
549
|
{
|
|
554
|
-
"name": "
|
|
555
|
-
"
|
|
550
|
+
"name": "mev_commission_index",
|
|
551
|
+
"docs": [
|
|
552
|
+
"Current index in mev_commission_history circular buffer (0-9)"
|
|
553
|
+
],
|
|
554
|
+
"type": "u8"
|
|
556
555
|
},
|
|
557
556
|
{
|
|
558
|
-
"name": "
|
|
559
|
-
"
|
|
557
|
+
"name": "last_mev_commission_update",
|
|
558
|
+
"docs": [
|
|
559
|
+
"Last epoch when MEV commission was updated"
|
|
560
|
+
],
|
|
561
|
+
"type": "u64"
|
|
560
562
|
},
|
|
561
563
|
{
|
|
562
564
|
"name": "bump",
|
|
565
|
+
"docs": [
|
|
566
|
+
"PDA bump seed"
|
|
567
|
+
],
|
|
563
568
|
"type": "u8"
|
|
564
569
|
}
|
|
565
570
|
]
|