From 6d15d5f214140364c751ed9795f66b547d4296ff Mon Sep 17 00:00:00 2001 From: will-2012 Date: Fri, 26 May 2023 11:35:45 +0800 Subject: [PATCH] build: update greenfield chain dependency --- base/gfspapp/gfsp_mdmgr.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- modular/blocksyncer/blocksyncer_indexer.go | 4 ++-- modular/blocksyncer/blocksyncer_options.go | 4 ++-- modular/executor/execute_replicate.go | 1 + 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/base/gfspapp/gfsp_mdmgr.go b/base/gfspapp/gfsp_mdmgr.go index ac1f6673b..e9262e559 100644 --- a/base/gfspapp/gfsp_mdmgr.go +++ b/base/gfspapp/gfsp_mdmgr.go @@ -17,7 +17,7 @@ type Option func(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error // NewModularFunc defines the module new instance func type. type NewModularFunc = func(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error) -// ModularManager manages the modulus, record the module info, module info include: +// ModularManager manages the modules, record the module info, module info include: // module name, module description and new module func. Module name is an indexer for // starting, the start module name comes from config file or '--service' command flag. // Module description uses for 'list' command that shows the SP supports modules info. diff --git a/go.mod b/go.mod index b8462efb7..d72d39171 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 replace ( cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9 cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9 - github.com/bnb-chain/greenfield => github.com/bnb-chain/greenfield v0.2.0 + github.com/bnb-chain/greenfield => github.com/bnb-chain/greenfield v0.2.1-alpha.1 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0 github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 diff --git a/go.sum b/go.sum index eeee37a89..e0238df9d 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,8 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsy github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/bnb-chain/greenfield v0.2.0 h1:P31k1mUYiXmtfYLzEidVYS/4BLqoTl9QnpWXd4JqHZM= -github.com/bnb-chain/greenfield v0.2.0/go.mod h1:JudGigAvhG6lcEh8/U5a3bU4VunrrPdei/KJ6DDrPfQ= +github.com/bnb-chain/greenfield v0.2.1-alpha.1 h1:0WASaBcUy/thiwu28m6i3vh8klOgaX7vPHD2bLZsBcI= +github.com/bnb-chain/greenfield v0.2.1-alpha.1/go.mod h1:FK+Vg+IfLYlA+o9q81qrLufQaQKm4Vz9G0/u4fG7bO8= github.com/bnb-chain/greenfield-cometbft v0.0.1 h1:pX8S9oZKjWJCrxH07l6rbU3zee9txZ11+UwO9stsNMQ= github.com/bnb-chain/greenfield-cometbft v0.0.1/go.mod h1:9q11eHNRY9FDwFH+4pompzPNGv//Z3VcfvkELaHJPMs= github.com/bnb-chain/greenfield-common/go v0.0.0-20230512062756-5d7790d0ccbf h1:5HxLNqgYHNV7Cfaepws3vejeI49aWry7ON2k+a23K10= diff --git a/modular/blocksyncer/blocksyncer_indexer.go b/modular/blocksyncer/blocksyncer_indexer.go index eaeb73580..e8dfb3971 100644 --- a/modular/blocksyncer/blocksyncer_indexer.go +++ b/modular/blocksyncer/blocksyncer_indexer.go @@ -69,7 +69,7 @@ func (i *Impl) HandleEvent(ctx context.Context, block *coretypes.ResultBlock, tx // Process fetches a block for a given height and associated metadata and export it to a database. // It returns an error if any export process fails. func (i *Impl) Process(height uint64) error { - log.Debugw("processing block", "height", height) + // log.Debugw("processing block", "height", height) var block *coretypes.ResultBlock var events *coretypes.ResultBlockResults var txs []*types.Tx @@ -270,7 +270,7 @@ func (i *Impl) Processed(ctx context.Context, height uint64) (bool, error) { if err != nil { return false, err } - log.Infof("epoch height:%d, cur height: %d", ep.BlockHeight, height) + // log.Infof("epoch height:%d, cur height: %d", ep.BlockHeight, height) if ep.BlockHeight > int64(height) { heightKey := fmt.Sprintf("%s-%d", i.GetServiceName(), height) blockMap.Delete(heightKey) diff --git a/modular/blocksyncer/blocksyncer_options.go b/modular/blocksyncer/blocksyncer_options.go index 5f2f31d54..62f9ed3db 100644 --- a/modular/blocksyncer/blocksyncer_options.go +++ b/modular/blocksyncer/blocksyncer_options.go @@ -196,7 +196,7 @@ func (b *BlockSyncerModular) enqueueNewBlocks(context context.Context, exportQue select { case <-context.Done(): log.Infof("Receive cancel signal, enqueueNewBlocks routine will stop") - //close channel + // close channel close(exportQueue) return default: @@ -205,7 +205,7 @@ func (b *BlockSyncerModular) enqueueNewBlocks(context context.Context, exportQue latestBlockHeight := latestBlockHeightAny.(int64) // Enqueue all heights from the current height up to the latest height for ; currHeight <= uint64(latestBlockHeight); currHeight++ { - log.Debugw("enqueueing new block", "height", currHeight) + // log.Debugw("enqueueing new block", "height", currHeight) exportQueue <- currHeight } time.Sleep(config.GetAvgBlockTime()) diff --git a/modular/executor/execute_replicate.go b/modular/executor/execute_replicate.go index 4861502f9..d5c673f3a 100644 --- a/modular/executor/execute_replicate.go +++ b/modular/executor/execute_replicate.go @@ -277,6 +277,7 @@ func (e *ExecuteModular) doneReplicatePiece( approval.GetApprovedSpEndpoint(), approval, receive) if err != nil { log.CtxErrorw(ctx, "failed to done replicate piece", + "endpoint", approval.GetApprovedSpEndpoint(), "replicate_idx", replicateIdx, "error", err) return nil, nil, err }