diff --git a/chain/sub/bcast/consistent.go b/chain/sub/bcast/consistent.go index 89708432c..165476ffb 100644 --- a/chain/sub/bcast/consistent.go +++ b/chain/sub/bcast/consistent.go @@ -40,7 +40,7 @@ type bcastDict struct { } func (bd *bcastDict) load(key []byte) (*blksInfo, bool) { - v, ok := bd.m.Load(key) + v, ok := bd.m.Load(string(key)) if !ok { return nil, ok } @@ -48,11 +48,11 @@ func (bd *bcastDict) load(key []byte) (*blksInfo, bool) { } func (bd *bcastDict) store(key []byte, d *blksInfo) { - bd.m.Store(key, d) + bd.m.Store(string(key), d) } func (bd *bcastDict) blkLen(key []byte) int { - v, ok := bd.m.Load(key) + v, ok := bd.m.Load(string(key)) if !ok { return 0 } diff --git a/chain/sub/bcast/consistent_test.go b/chain/sub/bcast/consistent_test.go index ca84ab4b1..8beb0574f 100644 --- a/chain/sub/bcast/consistent_test.go +++ b/chain/sub/bcast/consistent_test.go @@ -61,7 +61,7 @@ func testSimpleDelivery(t *testing.T, cb *bcast.ConsistentBCast, epoch abi.Chain func TestSeveralEpochs(t *testing.T) { cb := bcast.NewConsistentBCast(TEST_DELAY) - numEpochs := 5 + numEpochs := 6 wg := new(sync.WaitGroup) wg.Add(numEpochs) for i := 0; i < numEpochs; i++ { @@ -83,7 +83,7 @@ func TestSeveralEpochs(t *testing.T) { }(i) } wg.Wait() - require.Equal(t, cb.Len(), bcast.GcLookback) + require.Equal(t, cb.Len(), numEpochs) } // bias is expected to be 0-1