Skip to content

Commit 5307f29

Browse files
authored
fix(schema): Rollback v15 ProveCommitAggregate param schema (#907)
Co-authored-by: Mike Greenberg <[email protected]>
1 parent 40f13b1 commit 5307f29

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lens/util/repo.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,15 @@ var bitfieldCountMarshaller = func(v interface{}) ([]byte, error) {
460460
return nil, err
461461
}
462462

463+
// this struct matches the param schema used in network v14
464+
// see https://github.com/filecoin-project/lily/pull/821/files#r821851219
463465
var ret = struct {
464-
Count uint64
465-
RLE []uint64
466-
}{}
466+
Count uint64 `json:"elemcount"`
467+
RLE []uint64 `json:"rle"`
468+
Type string `json:"_type"`
469+
}{
470+
Type: "bitfield",
471+
}
467472
if r.HasNext() {
468473
first, err := r.NextRun()
469474
if err != nil {

tasks/messages/message_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func TestParseMessageParams(t *testing.T) {
203203
ChainCommitEpoch: 1287345,
204204
}),
205205
wantMethod: "SubmitWindowedPoSt",
206-
wantEncoded: "{\"Partitions\":[{\"Index\":0,\"Skipped\":{\"Count\":0,\"RLE\":[0]}}],\"Proofs\":[{\"PoStProof\":9,\"ProofBytes\":\"j67Zt7FnIDTt+WZ+JicmOvZJWNShtEUKQp2djqEamrWFJlJ5WWGfhpTmYSimapHhjnSJoQYddySoqKHw6klIY6INz0A4aHmF2xveYKLYcqKxaB6Izis7zWyw4CMLTc3GE93wBuajQ32V1qH5qBsTw3ELzUdlFNgClUhHWushxg7kvmqvtmh9lipXzGnPnrG9p68KnBp40dvhiMBVedNch/pP7cxMH5piwGIQxsn99sQVrZxfVy1+y0SN30t03yjc\"}],\"ChainCommitEpoch\":1287345,\"ChainCommitRand\":\"VyY9gIC10V8w8C1ltrpjqNN6mkk3xgW3Stpnp2ThNW4=\",\"Deadline\":38}",
206+
wantEncoded: "{\"Partitions\":[{\"Index\":0,\"Skipped\":{\"elemcount\":0,\"rle\":[0],\"_type\":\"bitfield\"}}],\"Proofs\":[{\"PoStProof\":9,\"ProofBytes\":\"j67Zt7FnIDTt+WZ+JicmOvZJWNShtEUKQp2djqEamrWFJlJ5WWGfhpTmYSimapHhjnSJoQYddySoqKHw6klIY6INz0A4aHmF2xveYKLYcqKxaB6Izis7zWyw4CMLTc3GE93wBuajQ32V1qH5qBsTw3ELzUdlFNgClUhHWushxg7kvmqvtmh9lipXzGnPnrG9p68KnBp40dvhiMBVedNch/pP7cxMH5piwGIQxsn99sQVrZxfVy1+y0SN30t03yjc\"}],\"ChainCommitEpoch\":1287345,\"ChainCommitRand\":\"VyY9gIC10V8w8C1ltrpjqNN6mkk3xgW3Stpnp2ThNW4=\",\"Deadline\":38}",
207207
wantErr: false,
208208
deepEqual: true,
209209
},
@@ -235,7 +235,7 @@ func TestParseMessageParams(t *testing.T) {
235235
},
236236
}),
237237
wantMethod: "DeclareFaultsRecovered",
238-
wantEncoded: "{\"Recoveries\":[{\"Deadline\":1,\"Partition\":1,\"Sectors\":{\"Count\":10,\"RLE\":[1,10]}}]}",
238+
wantEncoded: "{\"Recoveries\":[{\"Deadline\":1,\"Partition\":1,\"Sectors\":{\"elemcount\":10,\"rle\":[1,10],\"_type\":\"bitfield\"}}]}",
239239
wantErr: false,
240240
},
241241
// from https://github.com/filecoin-project/lily/issues/892

0 commit comments

Comments
 (0)