Skip to content

Commit

Permalink
perf: logic
Browse files Browse the repository at this point in the history
  • Loading branch information
constwz committed Jun 4, 2024
1 parent d16c3c2 commit d96a47c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions base/gfspvgmgr/virtual_group_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const (
VirtualGroupManagerSpace = "VirtualGroupManager"
RefreshMetaInterval = 5 * time.Second
MaxStorageUsageRatio = 0.95
DefaultInitialGVGStakingStorageSize = uint64(2) * 1024 * 1024 * 1024 * 1024 // 2TB per GVG, chain side DefaultMaxStoreSizePerFamily is 64 TB
additionalGVGStakingStorageSize = uint64(1) * 1024 * 1024 * 1024 * 1024 // 1TB
DefaultInitialGVGStakingStorageSize = uint64(1) * 1024 * 1024 * 1024 * 1024 // 1TB per GVG, chain side DefaultMaxStoreSizePerFamily is 64 TB
additionalGVGStakingStorageSize = uint64(1) * 1024 * 1024 * 1024 * 512 // 0.5TB

defaultSPCheckTimeout = 3 * time.Second
defaultSPHealthCheckerInterval = 10 * time.Second
Expand Down
2 changes: 1 addition & 1 deletion base/gnfd/gnfd_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ func (g *Gnfd) ConfirmTransaction(ctx context.Context, txHash string) (*sdk.TxRe
if strings.Contains(err.Error(), "not found") {
// Tx not found, wait for next block and try again
if err = g.WaitForNextBlock(ctx); err != nil {
return nil, err
log.Warnf("failed to wait for next block err:%v", err)
}
continue
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/mock v1.6.0
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
Expand Down Expand Up @@ -308,7 +308,7 @@ replace (
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.6.1-0.20240419024340-b5c75cfd8110
github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1
github.com/forbole/juno/v4 => github.com/bnb-chain/juno/v4 v4.0.0-20240422102216-0039530fcfb2
github.com/forbole/juno/v4 => github.com/bnb-chain/juno/v4 v4.0.0-20240604033531-028f2cc8f76d
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20231206043955-0855e0965b
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20231206043955-0855e0965bc8/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp9NnaM=
github.com/bnb-chain/greenfield-iavl v0.20.1 h1:y3L64GU99otNp27/xLVBTDbv4eroR6CzoYz0rbaVotM=
github.com/bnb-chain/greenfield-iavl v0.20.1/go.mod h1:oLksTs8dfh7DYIKBro7hbRQ+ewls7ghJ27pIXlbEXyI=
github.com/bnb-chain/juno/v4 v4.0.0-20240422102216-0039530fcfb2 h1:Zpq40LEvqzaqtT7QqISASBg6E51SZPAWLQ5gdbAtsfk=
github.com/bnb-chain/juno/v4 v4.0.0-20240422102216-0039530fcfb2/go.mod h1:p+KkPIHURpqUJOdXanhhYgZpTLQxGZWkrAwtUaOuPlM=
github.com/bnb-chain/juno/v4 v4.0.0-20240604033531-028f2cc8f76d h1:a5Q944ZvZK4K3lDkbIqweZd1CqEE8gmxph+wpTQzE3k=
github.com/bnb-chain/juno/v4 v4.0.0-20240604033531-028f2cc8f76d/go.mod h1:p+KkPIHURpqUJOdXanhhYgZpTLQxGZWkrAwtUaOuPlM=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
Expand Down
2 changes: 2 additions & 0 deletions modular/blocksyncer/blocksyncer_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func (b *BlockSyncerModular) getLatestBlockHeight(ctx context.Context) {
return
case <-ticker.C:
{
rpcStartTime := time.Now()
latestBlockHeight, err := b.parserCtx.Node.LatestHeight()
if err != nil {
log.Errorw("failed to get last block from RPCConfig client",
Expand All @@ -273,6 +274,7 @@ func (b *BlockSyncerModular) getLatestBlockHeight(ctx context.Context) {
continue
}
metrics.ChainLatestHeight.Set(float64(latestBlockHeight))
metrics.ChainRPCTime.Set(float64(time.Since(rpcStartTime).Milliseconds()))
metrics.GoRoutineCount.Set(float64(runtime.NumGoroutine()))
Cast(b.parserCtx.Indexer).GetLatestBlockHeight().Store(latestBlockHeight)
}
Expand Down

0 comments on commit d96a47c

Please sign in to comment.