Skip to content

Commit

Permalink
Fix: do not use state proof verification (#329)
Browse files Browse the repository at this point in the history
* fix: do not use state proof verification

Signed-off-by: failfmi <[email protected]>

* remove state proof verification

Signed-off-by: failfmi <[email protected]>
  • Loading branch information
failfmi authored Nov 10, 2021
1 parent 2cf8697 commit 378f0d7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
4 changes: 2 additions & 2 deletions app/services/read-only/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (s Service) FindAssetTransfer(
for {
response, err := fetch()
if err != nil {
s.logger.Errorf("[%s] - Failed to get token burn transactions after timestamp. Error: [%s]", transferID, err)
s.logger.Errorf("[%s] - Failed to get transactions after timestamp. Error: [%s]", transferID, err)
continue
}

Expand Down Expand Up @@ -117,7 +117,7 @@ func (s Service) FindTransfer(
for {
response, err := fetch()
if err != nil {
s.logger.Errorf("[%s] - Failed to get token burn transactions after timestamp. Error: [%s]", transferID, err)
s.logger.Errorf("[%s] - Failed to get transactions after timestamp. Error: [%s]", transferID, err)
continue
}

Expand Down
15 changes: 0 additions & 15 deletions app/services/transfers/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"errors"
"fmt"
"github.com/hashgraph/hedera-sdk-go/v2"
"github.com/hashgraph/hedera-state-proof-verifier-go/stateproof"
hedera_mirror_node "github.com/limechain/hedera-eth-bridge-validator/app/clients/hedera/mirror-node/model"
"github.com/limechain/hedera-eth-bridge-validator/app/domain/client"
"github.com/limechain/hedera-eth-bridge-validator/app/domain/repository"
Expand Down Expand Up @@ -106,20 +105,6 @@ func (ts *Service) SanityCheckTransfer(tx hedera_mirror_node.Transaction) (int64
return 0, "", errors.New(fmt.Sprintf("[%s] - Could not parse transaction memo [%s]. Error: [%s]", tx.TransactionID, tx.MemoBase64, e))
}

stateProof, e := ts.mirrorNode.GetStateProof(tx.TransactionID)
if e != nil {
return 0, "", errors.New(fmt.Sprintf("Could not GET state proof. Error [%s]", e))
}

verified, e := stateproof.Verify(tx.TransactionID, stateProof)
if e != nil {
return 0, "", errors.New(fmt.Sprintf("State proof verification failed. Error [%s]", e))
}

if !verified {
return 0, "", errors.New("invalid state proof")
}

memoArgs := strings.Split(m, "-")
chainId, _ := strconv.ParseInt(memoArgs[0], 10, 64)
evmAddress := memoArgs[1]
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/go-chi/render v1.0.1
github.com/golang/protobuf v1.5.2
github.com/hashgraph/hedera-sdk-go/v2 v2.1.5-beta.3
github.com/hashgraph/hedera-state-proof-verifier-go v0.0.0-20210331132016-d77f113cf098
github.com/pkg/errors v0.9.1
github.com/rs/cors v1.7.0
github.com/sirupsen/logrus v1.4.2
Expand Down
9 changes: 0 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,8 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/hashgraph/hedera-sdk-go/v2 v2.1.4 h1:hEjxbOZGkvTDVWjjGuKW+XxtDOZ5FiG8+8f9MqBMW8s=
github.com/hashgraph/hedera-sdk-go/v2 v2.1.4/go.mod h1:ehMpGGK3Lcgyfh/d/Wv/dUSl2TEINj/dj7FK59/E544=
github.com/hashgraph/hedera-sdk-go/v2 v2.1.5-beta.3 h1:tfg8FXOAdm5YkhOTt8Fsk+9RXMl7tCJEA2AiHUSq9gw=
github.com/hashgraph/hedera-sdk-go/v2 v2.1.5-beta.3/go.mod h1:uAsirNJ5vIr7OA/ofhgQQQYIHGlfpjiQADesfEVQs9Y=
github.com/hashgraph/hedera-state-proof-verifier-go v0.0.0-20210331132016-d77f113cf098 h1:QaV7TwHtMeAaZ2mlizrj6hAPyiH+AO5+9eaKd0fKGso=
github.com/hashgraph/hedera-state-proof-verifier-go v0.0.0-20210331132016-d77f113cf098/go.mod h1:D1qohq2viKVRoUEMosy5w2oRmIV72paRaKX0Jkj0RkE=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
Expand Down Expand Up @@ -735,8 +731,6 @@ google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvx
google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506 h1:uLBY0yHDCj2PMQ98KWDSIDFwn9zK2zh+tgWtbvPPBjI=
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210324141432-3032e8ff099e h1:IYrHTUywwtorLXynts01yby09nLqYNNnnveUnnLzaYA=
google.golang.org/genproto v0.0.0-20210324141432-3032e8ff099e/go.mod h1:f2Bd7+2PlaVKmvKQ52aspJZXIDaRQBVdOOBfJ5i8OEs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
Expand All @@ -746,8 +740,6 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0 h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
Expand All @@ -758,7 +750,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
Expand Down

0 comments on commit 378f0d7

Please sign in to comment.