From 7d6cdfed7c333688a76d92c5b364fa4c5d9b8747 Mon Sep 17 00:00:00 2001 From: randyahx <62416962+randyahx@users.noreply.github.com> Date: Sun, 8 Oct 2023 11:00:14 +0800 Subject: [PATCH] release: draft release for v1.0.0 (#90) * update dependencies * Update hash_verifier.go --- CHANGELOG.md | 3 +++ go.mod | 8 ++++---- go.sum | 16 ++++++++-------- verifier/hash_verifier.go | 4 ---- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e8ec46..d71ca78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## v1.0.0 +This release updates the dependencies to adapt to Greenfield v1.0.0. + ## v0.0.7 This release updates the dependencies to adapt to Greenfield v0.2.6 and adds a bugfix to handle events where components cannot be fetched successfully for hash verification. diff --git a/go.mod b/go.mod index f04ca7f..2548200 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( cosmossdk.io/math v1.0.1 github.com/avast/retry-go/v4 v4.3.1 github.com/aws/aws-sdk-go v1.40.45 - github.com/bnb-chain/greenfield v0.2.6 + github.com/bnb-chain/greenfield v1.0.0 github.com/bnb-chain/greenfield-common/go v0.0.0-20230830120314-a54ffd6da39f - github.com/bnb-chain/greenfield-go-sdk v0.2.6 + github.com/bnb-chain/greenfield-go-sdk v1.0.0 github.com/cometbft/cometbft v0.37.2 github.com/cosmos/cosmos-sdk v0.47.3 github.com/ethereum/go-ethereum v1.10.26 @@ -170,10 +170,10 @@ replace ( cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0 - github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.3 + github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 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 v0.2.6 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.0.0 github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/ferranbt/fastssz => github.com/prysmaticlabs/fastssz v0.0.0-20220110145812-fafb696cae88 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 diff --git a/go.sum b/go.sum index e24cb88..63680f7 100644 --- a/go.sum +++ b/go.sum @@ -166,22 +166,22 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/bnb-chain/greenfield v0.2.6 h1:U40wmSBQR4Wd0HiVCu/J6zqoLS4YUrvNgyuX71kgK3U= -github.com/bnb-chain/greenfield v0.2.6/go.mod h1:8kGVzKu3BEbpotk2Lmp/OzPh+nhbMsuUJueZtn0he4s= -github.com/bnb-chain/greenfield-cometbft v0.0.3 h1:tv8NMy3bzX/1urqXGQIIAZSLy83loiI+dG0VKeyh1CY= -github.com/bnb-chain/greenfield-cometbft v0.0.3/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk= +github.com/bnb-chain/greenfield v1.0.0 h1:eg8jFKfbM8ZBKYJ40MZvZtJMtbIcM17tnd7OvAoMC7g= +github.com/bnb-chain/greenfield v1.0.0/go.mod h1:HAUcv20wBECrbyvVvtoAgvpeedr6plgz3m75FJ7Xxdg= +github.com/bnb-chain/greenfield-cometbft v1.0.0 h1:0r6hOJWD/+es0gxP/exKuN/krgXAr3LCn5/XlcgDWr8= +github.com/bnb-chain/greenfield-cometbft v1.0.0/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= github.com/bnb-chain/greenfield-common/go v0.0.0-20230830120314-a54ffd6da39f h1:zJvB2wCd80DQ9Nh/ZNQiP8MrHygSpDoav7OzHyIi/pM= github.com/bnb-chain/greenfield-common/go v0.0.0-20230830120314-a54ffd6da39f/go.mod h1:it3JJVHeG9Wp4QED2GkY/7V9Qo3BuPdoC5/4/U6ecJM= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.6 h1:aPrd2nG2nYZr8nSmGgN8efus6sni4OIZ1Bdx6s+mS3A= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.6/go.mod h1:y3hDhQhil5hMIhwBTpu07RZBF30ZITkoE+GHhVZChtY= +github.com/bnb-chain/greenfield-cosmos-sdk v1.0.0 h1:hWRvYunA4Um19gwL1SVfMwN9l431ROC7XZ+A5+xM/Bk= +github.com/bnb-chain/greenfield-cosmos-sdk v1.0.0/go.mod h1:y3hDhQhil5hMIhwBTpu07RZBF30ZITkoE+GHhVZChtY= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp9NnaM= -github.com/bnb-chain/greenfield-go-sdk v0.2.6 h1:CGmMK+Ie3ZXae86rGYJnaF7FmO+y92S4a/Qp7DzxhLU= -github.com/bnb-chain/greenfield-go-sdk v0.2.6/go.mod h1:MrxZcdoK/YC8o0wECOv8fskozBokekxApLbi1P6qeTI= +github.com/bnb-chain/greenfield-go-sdk v1.0.0 h1:VjR3PQkn0DdMxHsGQQTTn2ATQiQWcHCtbi7LJHDRTYs= +github.com/bnb-chain/greenfield-go-sdk v1.0.0/go.mod h1:/VDQfd7KMa5Kl1bBA9XZ9Fq8NZJ5i8bXev0shIZfy+E= 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/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= diff --git a/verifier/hash_verifier.go b/verifier/hash_verifier.go index 883034c..986e3f1 100644 --- a/verifier/hash_verifier.go +++ b/verifier/hash_verifier.go @@ -77,7 +77,6 @@ func (v *Verifier) verifyHash() error { logging.Logger.Errorf("verifier failed to retrieve the earliest events from db to begin verification, err=%+v", err.Error()) return err } - // TODO: Remove after debugging fetchedEvents := []uint64{} for _, v := range events { fetchedEvents = append(fetchedEvents, v.ChallengeId) @@ -195,7 +194,6 @@ func (v *Verifier) verifyForSingleEvent(event *model.Event) error { _ = retry.Do(func() error { challengeRes, challengeResErr = v.executor.GetChallengeResultFromSp(event.ObjectId, endpoint, int(event.SegmentIndex), int(event.RedundancyIndex)) if challengeResErr != nil { - // TODO: Create error code list for SP side logging.Logger.Errorf("error getting challenge result from sp for challengeId: %d, objectId: %s, err=%s", event.ChallengeId, event.ObjectId, challengeResErr.Error()) } return challengeResErr @@ -261,7 +259,6 @@ func (v *Verifier) preCheck(event *model.Event, currentHeight uint64) error { if heartbeatInterval == 0 { panic("heartbeat interval should not zero, potential bug") } - // TODO: Comment this if debugging if event.ChallengerAddress == "" && event.ChallengeId%heartbeatInterval != 0 && event.ChallengeId > v.deduplicationInterval { found, err := v.dataProvider.IsEventExistsBetween(event.ObjectId, event.SpOperatorAddress, event.ChallengeId-v.deduplicationInterval, event.ChallengeId-1) @@ -288,7 +285,6 @@ func (v *Verifier) computeRootHash(segmentIndex uint32, pieceData []byte, checks func (v *Verifier) compareHashAndUpdate(challengeId uint64, chainRootHash []byte, spRootHash []byte) error { if bytes.Equal(chainRootHash, spRootHash) { - // TODO: Revert this if debugging err := v.dataProvider.UpdateEventStatusVerifyResult(challengeId, model.Verified, model.HashMatched) if err != nil { return err