From 1ac0c9a926269c790950cdd79214c4c545aa896f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Tue, 2 Mar 2021 21:29:24 +0000 Subject: [PATCH] address review comments. --- chain/store/store.go | 5 +++++ chain/sync.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chain/store/store.go b/chain/store/store.go index 6a3febcc8..e0660495e 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -1549,6 +1549,11 @@ func (cs *ChainStore) WalkSnapshot(ctx context.Context, ts *types.TipSet, inclRe } func (cs *ChainStore) Import(r io.Reader) (*types.TipSet, error) { + // TODO: writing only to the state blockstore is incorrect. + // At this time, both the state and chain blockstores are backed by the + // universal store. When we physically segregate the stores, we will need + // to route state objects to the state blockstore, and chain objects to + // the chain blockstore. header, err := car.LoadCar(cs.StateBlockstore(), r) if err != nil { return nil, xerrors.Errorf("loadcar failed: %w", err) diff --git a/chain/sync.go b/chain/sync.go index 96f337c4f..88237eb5a 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -1172,7 +1172,7 @@ func (syncer *Syncer) checkBlockMessages(ctx context.Context, b *types.FullBlock } // Finally, flush. - return vm.Copy(ctx, tmpbs, syncer.store.StateBlockstore(), mrcid) + return vm.Copy(ctx, tmpbs, syncer.store.ChainBlockstore(), mrcid) } func (syncer *Syncer) verifyBlsAggregate(ctx context.Context, sig *crypto.Signature, msgs []cid.Cid, pubks [][]byte) error {