Skip to content

Commit e230076

Browse files
authored
Refactor operator onboarding (#35)
1 parent 531a8b1 commit e230076

File tree

12 files changed

+255
-765
lines changed

12 files changed

+255
-765
lines changed

subgraphs/ethereum/schema.graphql

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ type ValidatorRegistration @entity {
77

88
"The validator withdrawal credentials"
99
withdrawalCredentials: Bytes!
10+
11+
"The registration index (little endian)"
12+
index: Bytes!
13+
14+
"The block number the registration was created at"
15+
createdAtBlock: BigInt!
16+
17+
"The timestamp the registration was created at"
18+
createdAtTimestamp: BigInt!
1019
}
1120

1221
"""

subgraphs/ethereum/src/mappings/validatorRegistration.ts

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export function handleDepositEvent(event: DepositEvent): void {
99
if (validator == null) {
1010
validator = new ValidatorRegistration(publicKey);
1111
validator.withdrawalCredentials = event.params.withdrawal_credentials;
12+
validator.index = event.params.index;
13+
validator.createdAtBlock = event.block.number;
14+
validator.createdAtTimestamp = event.block.timestamp;
1215
validator.save();
1316
}
1417

subgraphs/stakewise/config/goerli.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"startBlock": "4468087"
66
},
77
"poolValidators": {
8-
"address": "0x0d92156861a0bc7037cc21470327bd3bc750eb1d",
9-
"startBlock": "5905172"
8+
"address": "0x908c06affda0ffdbb4578629aa8ccff372e510b6",
9+
"startBlock": "6049456"
1010
},
1111
"merkleDistributor": {
1212
"address": "0x6ef0172b79131c66c7012db3545d637b116feb12",
@@ -17,8 +17,8 @@
1717
"startBlock": "4623211"
1818
},
1919
"oracles": {
20-
"address": "0x06b0c9476315634dcc59aa3f3f7d5df6fecbaa90",
21-
"startBlock": "5905173"
20+
"address": "0x4bbaa17efd71683dcb9c769dd38e7674994fe38d",
21+
"startBlock": "6049460"
2222
},
2323
"stakeWiseToken": {
2424
"address": "0x0e2497aacec2755d831e4afdea25b4ef1b823855",

subgraphs/stakewise/packages/abis/Oracles.json

+92-174
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,4 @@
11
[
2-
{
3-
"anonymous": false,
4-
"inputs": [
5-
{
6-
"indexed": true,
7-
"internalType": "address",
8-
"name": "sender",
9-
"type": "address"
10-
},
11-
{
12-
"indexed": true,
13-
"internalType": "address",
14-
"name": "oracle",
15-
"type": "address"
16-
},
17-
{
18-
"indexed": true,
19-
"internalType": "address",
20-
"name": "operator",
21-
"type": "address"
22-
},
23-
{
24-
"indexed": false,
25-
"internalType": "bytes",
26-
"name": "publicKey",
27-
"type": "bytes"
28-
},
29-
{
30-
"indexed": false,
31-
"internalType": "uint256",
32-
"name": "nonce",
33-
"type": "uint256"
34-
}
35-
],
36-
"name": "FinalizeValidatorVoteSubmitted",
37-
"type": "event"
38-
},
39-
{
40-
"anonymous": false,
41-
"inputs": [
42-
{
43-
"indexed": true,
44-
"internalType": "address",
45-
"name": "sender",
46-
"type": "address"
47-
},
48-
{
49-
"indexed": true,
50-
"internalType": "address",
51-
"name": "oracle",
52-
"type": "address"
53-
},
54-
{
55-
"indexed": true,
56-
"internalType": "address",
57-
"name": "operator",
58-
"type": "address"
59-
},
60-
{
61-
"indexed": false,
62-
"internalType": "bytes",
63-
"name": "publicKey",
64-
"type": "bytes"
65-
},
66-
{
67-
"indexed": false,
68-
"internalType": "uint256",
69-
"name": "nonce",
70-
"type": "uint256"
71-
}
72-
],
73-
"name": "InitializeValidatorVoteSubmitted",
74-
"type": "event"
75-
},
762
{
773
"anonymous": false,
784
"inputs": [
@@ -162,6 +88,43 @@
16288
"name": "Paused",
16389
"type": "event"
16490
},
91+
{
92+
"anonymous": false,
93+
"inputs": [
94+
{
95+
"indexed": true,
96+
"internalType": "address",
97+
"name": "sender",
98+
"type": "address"
99+
},
100+
{
101+
"indexed": true,
102+
"internalType": "address",
103+
"name": "oracle",
104+
"type": "address"
105+
},
106+
{
107+
"indexed": true,
108+
"internalType": "address",
109+
"name": "operator",
110+
"type": "address"
111+
},
112+
{
113+
"indexed": false,
114+
"internalType": "bytes",
115+
"name": "publicKey",
116+
"type": "bytes"
117+
},
118+
{
119+
"indexed": false,
120+
"internalType": "uint256",
121+
"name": "nonce",
122+
"type": "uint256"
123+
}
124+
],
125+
"name": "RegisterValidatorVoteSubmitted",
126+
"type": "event"
127+
},
165128
{
166129
"anonymous": false,
167130
"inputs": [
@@ -391,56 +354,6 @@
391354
"stateMutability": "view",
392355
"type": "function"
393356
},
394-
{
395-
"inputs": [
396-
{
397-
"components": [
398-
{
399-
"internalType": "address",
400-
"name": "operator",
401-
"type": "address"
402-
},
403-
{
404-
"internalType": "bytes32",
405-
"name": "withdrawalCredentials",
406-
"type": "bytes32"
407-
},
408-
{
409-
"internalType": "bytes32",
410-
"name": "depositDataRoot",
411-
"type": "bytes32"
412-
},
413-
{
414-
"internalType": "bytes",
415-
"name": "publicKey",
416-
"type": "bytes"
417-
},
418-
{
419-
"internalType": "bytes",
420-
"name": "signature",
421-
"type": "bytes"
422-
}
423-
],
424-
"internalType": "struct IPoolValidators.DepositData",
425-
"name": "depositData",
426-
"type": "tuple"
427-
},
428-
{
429-
"internalType": "bytes32[]",
430-
"name": "merkleProof",
431-
"type": "bytes32[]"
432-
},
433-
{
434-
"internalType": "bytes[]",
435-
"name": "signatures",
436-
"type": "bytes[]"
437-
}
438-
],
439-
"name": "finalizeValidator",
440-
"outputs": [],
441-
"stateMutability": "nonpayable",
442-
"type": "function"
443-
},
444357
{
445358
"inputs": [
446359
{
@@ -583,56 +496,6 @@
583496
"stateMutability": "nonpayable",
584497
"type": "function"
585498
},
586-
{
587-
"inputs": [
588-
{
589-
"components": [
590-
{
591-
"internalType": "address",
592-
"name": "operator",
593-
"type": "address"
594-
},
595-
{
596-
"internalType": "bytes32",
597-
"name": "withdrawalCredentials",
598-
"type": "bytes32"
599-
},
600-
{
601-
"internalType": "bytes32",
602-
"name": "depositDataRoot",
603-
"type": "bytes32"
604-
},
605-
{
606-
"internalType": "bytes",
607-
"name": "publicKey",
608-
"type": "bytes"
609-
},
610-
{
611-
"internalType": "bytes",
612-
"name": "signature",
613-
"type": "bytes"
614-
}
615-
],
616-
"internalType": "struct IPoolValidators.DepositData",
617-
"name": "depositData",
618-
"type": "tuple"
619-
},
620-
{
621-
"internalType": "bytes32[]",
622-
"name": "merkleProof",
623-
"type": "bytes32[]"
624-
},
625-
{
626-
"internalType": "bytes[]",
627-
"name": "signatures",
628-
"type": "bytes[]"
629-
}
630-
],
631-
"name": "initializeValidator",
632-
"outputs": [],
633-
"stateMutability": "nonpayable",
634-
"type": "function"
635-
},
636499
{
637500
"inputs": [
638501
{
@@ -723,6 +586,61 @@
723586
"stateMutability": "view",
724587
"type": "function"
725588
},
589+
{
590+
"inputs": [
591+
{
592+
"components": [
593+
{
594+
"internalType": "address",
595+
"name": "operator",
596+
"type": "address"
597+
},
598+
{
599+
"internalType": "bytes32",
600+
"name": "withdrawalCredentials",
601+
"type": "bytes32"
602+
},
603+
{
604+
"internalType": "bytes32",
605+
"name": "depositDataRoot",
606+
"type": "bytes32"
607+
},
608+
{
609+
"internalType": "bytes",
610+
"name": "publicKey",
611+
"type": "bytes"
612+
},
613+
{
614+
"internalType": "bytes",
615+
"name": "signature",
616+
"type": "bytes"
617+
}
618+
],
619+
"internalType": "struct IPoolValidators.DepositData",
620+
"name": "depositData",
621+
"type": "tuple"
622+
},
623+
{
624+
"internalType": "bytes32[]",
625+
"name": "merkleProof",
626+
"type": "bytes32[]"
627+
},
628+
{
629+
"internalType": "bytes32",
630+
"name": "validatorsDepositCount",
631+
"type": "bytes32"
632+
},
633+
{
634+
"internalType": "bytes[]",
635+
"name": "signatures",
636+
"type": "bytes[]"
637+
}
638+
],
639+
"name": "registerValidator",
640+
"outputs": [],
641+
"stateMutability": "nonpayable",
642+
"type": "function"
643+
},
726644
{
727645
"inputs": [
728646
{

0 commit comments

Comments
 (0)