diff --git a/core/exchange.go b/core/exchange.go index 3f55bbf990..0f90274309 100644 --- a/core/exchange.go +++ b/core/exchange.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "github.com/tendermint/tendermint/types" "time" "golang.org/x/sync/errgroup" @@ -177,7 +178,11 @@ func (ce *Exchange) getExtendedHeaderByHeight(ctx context.Context, height *int64 if err != nil { return nil, fmt.Errorf("extending block data for height %d: %w", b.Header.Height, err) } - // create extended header + + // TODO(@Wondertan): This is a hack to deref Data, allowing GC to pick it up. + // The better footgun-less solution is to change core.ResultSignedBlock fields to be pointers instead of values. + b.Data = types.Data{} + eh, err := ce.construct(&b.Header, &b.Commit, &b.ValidatorSet, eds) if err != nil { panic(fmt.Errorf("constructing extended header for height %d: %w", b.Header.Height, err))