Skip to content

Commit fb99871

Browse files
authored
Merge pull request #57 from datachainlab/risc0-v3
Bump risc0 to v3 Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
2 parents 42e490f + d5cc0af commit fb99871

File tree

8 files changed

+23
-10
lines changed

8 files changed

+23
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ lcp-go includes the followings:
77

88
## Dependencies
99

10-
- [lcp v0.2.15](https://github.com/datachainlab/lcp/releases/tag/v0.2.15)
10+
- [lcp v0.2.17](https://github.com/datachainlab/lcp/releases/tag/v0.2.17)
1111
- [ibc-go v8.2](https://github.com/cosmos/ibc-go/releases/tag/v8.2.0)
12-
- [yui-relayer v0.5.15](https://github.com/hyperledger-labs/yui-relayer/releases/tag/v0.5.15)
12+
- [yui-relayer v0.5.16](https://github.com/hyperledger-labs/yui-relayer/releases/tag/v0.5.16)
1313

1414
## How to run tests
1515

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/cosmos/cosmos-sdk v0.50.5
1111
github.com/cosmos/gogoproto v1.7.0
1212
github.com/cosmos/ibc-go/v8 v8.2.1
13-
github.com/datachainlab/go-risc0-verifier v0.1.1
13+
github.com/datachainlab/go-risc0-verifier v0.1.3
1414
github.com/deckarep/golang-set/v2 v2.6.0
1515
github.com/ethereum/go-ethereum v1.14.12
1616
github.com/gogo/protobuf v1.3.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
391391
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
392392
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
393393
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
394-
github.com/datachainlab/go-risc0-verifier v0.1.1 h1:M+GjE4tcbLAxJGX8oCC70yWv5gSXSgPJpBHZuyFB9kk=
395-
github.com/datachainlab/go-risc0-verifier v0.1.1/go.mod h1:O+uLSIdkN9rvqDXuZCnAOSPf/IT5SVjK/PxxJP3sPPU=
394+
github.com/datachainlab/go-risc0-verifier v0.1.3 h1:iEIVqGzLK1+AdZCfNqSxXJhMLDg7lEzbAfOZ8b/stRM=
395+
github.com/datachainlab/go-risc0-verifier v0.1.3/go.mod h1:O+uLSIdkN9rvqDXuZCnAOSPf/IT5SVjK/PxxJP3sPPU=
396396
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
397397
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
398398
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=

light-clients/lcp/types/update.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"os"
8+
"slices"
89
"strings"
910
"time"
1011

@@ -200,6 +201,11 @@ func (cs ClientState) verifyZKDCAPRegisterEnclaveKey(ctx sdk.Context, store stor
200201
return errorsmod.Wrapf(clienttypes.ErrInvalidHeader, "failed to recover operator address: %v", err)
201202
}
202203
}
204+
// ensure active operator if operators are set in the client state
205+
if len(cs.Operators) > 0 && !cs.ensureActiveOperator(operator) {
206+
return errorsmod.Wrapf(clienttypes.ErrInvalidHeader, "invalid operator: operator=%v not found in operators=%v", operator, cs.GetOperators())
207+
}
208+
203209
ek, expectedOperator, err := sgx.ParseReportData2(commit.ReportData())
204210
if err != nil {
205211
return errorsmod.Wrapf(clienttypes.ErrInvalidHeader, "failed to parse report data: %v", err)
@@ -591,6 +597,13 @@ func (cs ClientState) Contains(clientStore storetypes.KVStore, ek common.Address
591597
return clientStore.Has(enclaveKeyPath(ek))
592598
}
593599

600+
func (cs ClientState) ensureActiveOperator(operator common.Address) bool {
601+
if operator == (common.Address{}) {
602+
return false
603+
}
604+
return slices.Contains(cs.GetOperators(), operator)
605+
}
606+
594607
func (cs ClientState) GetEKInfo(clientStore storetypes.KVStore, ek common.Address) (*EKInfo, error) {
595608
if !cs.Contains(clientStore, ek) {
596609
return nil, nil

scripts/run_e2e_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export LCP_ENCLAVE_DEBUG=0
1010
# should be 0 or greater than `key_update_buffer_time` in the config
1111
export LCP_KEY_EXPIRATION=86400
1212
# LCP_RISC0_IMAGE_ID must be set to the same value as in the LCP service
13-
LCP_RISC0_IMAGE_ID=${LCP_RISC0_IMAGE_ID:-0xa5b1925a6471aa2d53847816b8c7ec5d09ff455583a4ae66915c402a3216029e}
13+
LCP_RISC0_IMAGE_ID=${LCP_RISC0_IMAGE_ID:-0xe5056aa7a8064abeb648b31d5efa8697a79d416b937cb917d1428cec91a56c67}
1414
export ZKDCAP=false
1515
export LCP_ZKDCAP_RISC0_MOCK=false
1616
export LCP_RISC0_IMAGE_ID

simapp/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ require (
7373
github.com/creachadair/atomicfile v0.3.1 // indirect
7474
github.com/creachadair/tomledit v0.0.24 // indirect
7575
github.com/danieljoos/wincred v1.1.2 // indirect
76-
github.com/datachainlab/go-risc0-verifier v0.1.1 // indirect
76+
github.com/datachainlab/go-risc0-verifier v0.1.3 // indirect
7777
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
7878
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
7979
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect

simapp/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
395395
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
396396
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
397397
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
398-
github.com/datachainlab/go-risc0-verifier v0.1.1 h1:M+GjE4tcbLAxJGX8oCC70yWv5gSXSgPJpBHZuyFB9kk=
399-
github.com/datachainlab/go-risc0-verifier v0.1.1/go.mod h1:O+uLSIdkN9rvqDXuZCnAOSPf/IT5SVjK/PxxJP3sPPU=
398+
github.com/datachainlab/go-risc0-verifier v0.1.3 h1:iEIVqGzLK1+AdZCfNqSxXJhMLDg7lEzbAfOZ8b/stRM=
399+
github.com/datachainlab/go-risc0-verifier v0.1.3/go.mod h1:O+uLSIdkN9rvqDXuZCnAOSPf/IT5SVjK/PxxJP3sPPU=
400400
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
401401
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
402402
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=

0 commit comments

Comments
 (0)