@@ -73,7 +73,7 @@ This slashing program supports two instructions `DuplicateBlockProof`, and
73
73
0 . ` proof_account ` , expected to be previously initialized with the proof data.
74
74
1 . ` instructions ` , Instructions sysvar
75
75
76
- ` DuplicateBlockProof ` has an instruction data of 81 bytes, containing:
76
+ ` DuplicateBlockProof ` has an instruction data of 273 bytes, containing:
77
77
78
78
- ` 0x00 ` , a fixed-value byte acting as the instruction discriminator
79
79
- ` offset ` , an unaligned eight-byte little-endian unsigned integer indicating
@@ -85,6 +85,14 @@ This slashing program supports two instructions `DuplicateBlockProof`, and
85
85
- ` destination ` , an unaligned 32 byte array representing the account to reclaim
86
86
the lamports if a successful slashing report account is created and then later
87
87
closed.
88
+ - ` shred_1_merkle_root ` , an unaligned 32 byte array representing the merkle root
89
+ of the first shred in the ` proof_account `
90
+ - ` shred_1_signature ` , an unaligned 64 byte array representing the signature
91
+ of ` node_pubkey ` on the first shred in the ` proof_account `
92
+ - ` shred_2_merkle_root ` , an unaligned 32 byte array representing the merkle root
93
+ of the second shred in the ` proof_account `
94
+ - ` shred_2_signature ` , an unaligned 64 byte array representing the signature
95
+ of ` node_pubkey ` on the second shred in the ` proof_account `
88
96
89
97
We expect the contents of the ` proof_account ` when read from ` offset ` to
90
98
deserialize to two byte arrays representing the duplicate shreds.
@@ -148,17 +156,17 @@ eligible for slashing.
148
156
In order to verify that ` shred1 ` and ` shred2 ` were correctly signed by
149
157
` node_pubkey ` we use instruction introspection.
150
158
151
- Using the ` Instructions ` sysvar we verify that the previous two instructions of
159
+ Using the ` Instructions ` sysvar we verify that the previous instruction of
152
160
this transaction are for the program ID
153
161
` Ed25519SigVerify111111111111111111111111111 `
154
162
155
- For each of these instructions , verify the instruction data:
163
+ For this instruction , verify the instruction data:
156
164
157
- - The first byte is ` 0x01 `
165
+ - The first byte is ` 0x02 `
158
166
- The second byte (padding) is ` 0x00 `
159
167
160
- And then deserialize the remaining instruction data as 2 byte little-endian
161
- unsigned integers:
168
+ Verify that the remaining instruction data represents two signature offsets
169
+ which is specified as 2 byte little-endian unsigned integers:
162
170
163
171
``` rust
164
172
struct Ed25519SignatureOffsets {
@@ -184,6 +192,9 @@ We use the deserialized offsets to calculate [\[3\]](#notes) the `pubkey`,
184
192
` message ` , and ` signature ` of each instruction and verify that they correspond
185
193
to the ` node_pubkey ` , ` merkle_root ` , and ` signature ` specified by the shred payload.
186
194
195
+ The instruction indices must point to the ` DuplicateBlockProof ` instruction and
196
+ the offsets into the instruction data where these values are stored.
197
+
187
198
If both proof and signer verification succeed, we continue on to store the incident.
188
199
189
200
---
0 commit comments