Skip to content

Commit 0e3c2e8

Browse files
Merge branch 'main' into main
2 parents 1b2a231 + bb2ff3b commit 0e3c2e8

19 files changed

Lines changed: 908 additions & 829 deletions

File tree

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
contents: read
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2626
with:
2727
fetch-depth: 2 # required to compare HEAD^
2828
- run: git diff --name-only HEAD^..HEAD

.github/workflows/git.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@v6
1919
- name: Block Fixup Commit Merge
2020
uses: 13rac1/block-fixup-merge-action@v2.0.0

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
os-name: jammy
3535

3636
steps:
37-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
3838
with:
3939
submodules: 'recursive'
4040
- uses: actions/setup-go@v6

docs/setup-option2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Make sure that you have the following required dependencies installed:
1010

1111
* CMake v3.5.1 or higher
1212

13-
* [Go](https://golang.org/) 1.23.x or higher
13+
* [Go](https://golang.org/) 1.25.x or higher
1414

1515
* Docker 18.09 (or higher) and docker-compose 1.25.x (or higher)
1616
Note that version from Ubuntu 18.04 is not recent enough! To upgrade, install a recent version following the instructions from [docker.com](https://docs.docker.com/compose/install/), e.g., for version 1.25.4 execute

ecc/chaincode/ecc.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func (t *EnclaveChaincode) initEnclave(stub shim.ChaincodeStubInterface) pb.Resp
5757
initMsg, err := t.Extractor.GetInitEnclaveMessage(stub)
5858
if err != nil {
5959
errMsg := fmt.Sprintf("getting initEnclave msg failed: %s", err.Error())
60-
logger.Errorf(errMsg)
60+
logger.Error(errMsg)
6161
return shim.Error(errMsg)
6262
}
6363

6464
chaincodeParams, err := t.Extractor.GetChaincodeParams(stub)
6565
if err != nil {
6666
errMsg := fmt.Sprintf("getting chaincode params failed: %s", err.Error())
67-
logger.Errorf(errMsg)
67+
logger.Error(errMsg)
6868
return shim.Error(errMsg)
6969
}
7070
serializedChaincodeParams, err := protoutil.Marshal(chaincodeParams)
@@ -75,7 +75,7 @@ func (t *EnclaveChaincode) initEnclave(stub shim.ChaincodeStubInterface) pb.Resp
7575
hostParams, err := t.Extractor.GetHostParams(stub)
7676
if err != nil {
7777
errMsg := fmt.Sprintf("getting host params failed: %s", err.Error())
78-
logger.Errorf(errMsg)
78+
logger.Error(errMsg)
7979
return shim.Error(errMsg)
8080
}
8181

@@ -88,7 +88,7 @@ func (t *EnclaveChaincode) initEnclave(stub shim.ChaincodeStubInterface) pb.Resp
8888
credentialsBytes, err := t.Enclave.Init(serializedChaincodeParams, serializedHostParams, initMsg.AttestationParams)
8989
if err != nil {
9090
errMsg := fmt.Sprintf("Enclave Init function failed: %s", err.Error())
91-
logger.Errorf(errMsg)
91+
logger.Error(errMsg)
9292
return shim.Error(errMsg)
9393
}
9494

@@ -102,14 +102,14 @@ func (t *EnclaveChaincode) invoke(stub shim.ChaincodeStubInterface) pb.Response
102102
serializedChaincodeRequest, err := t.Extractor.GetSerializedChaincodeRequest(stub)
103103
if err != nil {
104104
errMsg = fmt.Sprintf("cannot get chaincode request message from input: %s", err.Error())
105-
logger.Errorf(errMsg)
105+
logger.Error(errMsg)
106106
return shim.Error(errMsg)
107107
}
108108

109109
signedChaincodeResponseMessage, errInvoke := t.Enclave.ChaincodeInvoke(stub, serializedChaincodeRequest)
110110
if errInvoke != nil {
111111
errMsg = fmt.Sprintf("t.Enclave.Invoke failed: %s", errInvoke)
112-
logger.Errorf(errMsg)
112+
logger.Error(errMsg)
113113
// likely a chaincode error, so we still want response go back ...
114114
}
115115

@@ -139,14 +139,14 @@ func (t *EnclaveChaincode) endorse(stub shim.ChaincodeStubInterface) pb.Response
139139
chaincodeParams, err := t.Extractor.GetChaincodeParams(stub)
140140
if err != nil {
141141
errMsg := fmt.Sprintf("cannot extract chaincode params: %s", err.Error())
142-
logger.Errorf(errMsg)
142+
logger.Error(errMsg)
143143
return shim.Error(errMsg)
144144
}
145145

146146
signedResponseMsg, responseMsg, err := t.Extractor.GetChaincodeResponseMessages(stub)
147147
if err != nil {
148148
errMsg := fmt.Sprintf("cannot extract chaincode response message: %s", err.Error())
149-
logger.Errorf(errMsg)
149+
logger.Error(errMsg)
150150
return shim.Error(errMsg)
151151
}
152152

@@ -175,20 +175,20 @@ func (t *EnclaveChaincode) endorse(stub shim.ChaincodeStubInterface) pb.Response
175175
// check cc param.MSPID matches MSPID of endorser (Post-MVP)
176176

177177
// validate enclave endorsement signature
178-
logger.Debugf("Validating endorsement")
178+
logger.Debug("Validating endorsement")
179179
err = t.Validator.Validate(signedResponseMsg, attestedData)
180180
if err != nil {
181181
return shim.Error(err.Error())
182182
}
183183

184184
// replay read/writes from kvrwset from Enclave (to prepare commitment to ledger) and extract kvrwset for subsequent validation
185-
logger.Debugf("Replaying rwset")
185+
logger.Debug("Replaying rwset")
186186
err = t.Validator.ReplayReadWrites(stub, responseMsg.FpcRwSet)
187187
if err != nil {
188188
return shim.Error(err.Error())
189189
}
190190

191-
logger.Debugf("Endorsement successful")
191+
logger.Debug("Endorsement successful")
192192
return shim.Success([]byte("OK")) // make sure we have a non-empty return on success so we can distinguish success from failure in cli ...
193193
}
194194

ecc/chaincode/enclave/enclave.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package enclave
1212

1313
import (
1414
"context"
15+
"errors"
1516
"fmt"
1617
"unsafe"
1718

@@ -80,7 +81,7 @@ func (e *EnclaveStub) Init(chaincodeParams, hostParams, attestationParams []byte
8081
if ret != 0 {
8182
msg := fmt.Sprintf("can not create enclave (%s): Reason: %v", enclaveLibFile, ret)
8283
logger.Error(msg)
83-
return nil, fmt.Errorf(msg)
84+
return nil, errors.New(msg)
8485
}
8586
e.eid = eid
8687
e.sem.Release(1)
@@ -114,7 +115,7 @@ func (e *EnclaveStub) ChaincodeInvoke(stub shim.ChaincodeStubInterface, crmProto
114115
const scresmProtoBytesMaxLen = 1024 * 100 // Let's be really conservative ...
115116

116117
if !e.isInitialized {
117-
return nil, fmt.Errorf("enclave not yet initialized")
118+
return nil, errors.New("enclave not yet initialized")
118119
}
119120

120121
// register our stub for callbacks

ecc_go/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Install ego by running the following:
8080
```bash
8181
wget -qO- https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | apt-key add
8282
add-apt-repository "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu `lsb_release -cs` main"
83-
wget https://github.com/edgelesssys/ego/releases/download/v1.7.0/ego_1.7.0_amd64_ubuntu-22.04.deb
84-
apt install ./ego_1.7.0_amd64_ubuntu-22.04.deb build-essential libssl-dev
83+
wget https://github.com/edgelesssys/ego/releases/download/v1.8.1/ego_1.8.1_amd64_ubuntu-22.04.deb
84+
apt install ./ego_1.8.1_amd64_ubuntu-22.04.deb build-essential libssl-dev
8585
```
8686

8787
You can find more information about ego installation on the official [documentation](https://docs.edgeless.systems/ego/#/getting-started/install).

go.mod

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/hyperledger/fabric-private-chaincode
22

3-
go 1.23.5
3+
go 1.25.6
44

55
// Note:
66
// - fabric has a go.mod but the normal tagging, e.g., v2.2.0 does NOT
@@ -35,10 +35,10 @@ require (
3535
github.com/onsi/gomega v1.27.8
3636
github.com/pkg/errors v0.9.1
3737
github.com/spf13/cobra v1.7.0
38-
github.com/stretchr/testify v1.8.4
39-
golang.org/x/sync v0.5.0
40-
golang.org/x/tools v0.14.0
41-
google.golang.org/protobuf v1.33.0
38+
github.com/stretchr/testify v1.11.0
39+
golang.org/x/sync v0.19.0
40+
golang.org/x/tools v0.41.0
41+
google.golang.org/protobuf v1.36.6
4242
gopkg.in/yaml.v2 v2.4.0
4343
honnef.co/go/tools v0.4.3
4444
)
@@ -52,7 +52,7 @@ require (
5252
github.com/IBM/idemix/bccsp/types v0.0.0-20231107110234-4cf31dd43660 // indirect
5353
github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da // indirect
5454
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
55-
github.com/Microsoft/go-winio v0.6.1 // indirect
55+
github.com/Microsoft/go-winio v0.6.2 // indirect
5656
github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20231023164747-f3f972769504 // indirect
5757
github.com/benbjohnson/clock v1.3.5 // indirect
5858
github.com/beorn7/perks v1.0.1 // indirect
@@ -61,17 +61,16 @@ require (
6161
github.com/cloudflare/cfssl v1.4.1 // indirect
6262
github.com/consensys/bavard v0.1.13 // indirect
6363
github.com/consensys/gnark-crypto v0.12.1 // indirect
64-
github.com/containerd/containerd v1.7.13 // indirect
6564
github.com/containerd/log v0.1.0 // indirect
6665
github.com/davecgh/go-spew v1.1.1 // indirect
67-
github.com/docker/docker v26.1.0+incompatible // indirect
68-
github.com/docker/go-connections v0.5.0 // indirect
66+
github.com/docker/docker v28.5.2+incompatible // indirect
67+
github.com/docker/go-connections v0.6.0 // indirect
6968
github.com/docker/go-units v0.5.0 // indirect
7069
github.com/fsnotify/fsnotify v1.6.0 // indirect
7170
github.com/fsouza/go-dockerclient v1.10.0 // indirect
7271
github.com/go-kit/kit v0.10.0 // indirect
7372
github.com/go-logfmt/logfmt v0.5.1 // indirect
74-
github.com/go-logr/logr v1.3.0 // indirect
73+
github.com/go-logr/logr v1.4.3 // indirect
7574
github.com/go-openapi/jsonpointer v0.19.5 // indirect
7675
github.com/go-openapi/jsonreference v0.20.0 // indirect
7776
github.com/go-openapi/spec v0.20.8 // indirect
@@ -80,10 +79,9 @@ require (
8079
github.com/gobuffalo/envy v1.10.1 // indirect
8180
github.com/gobuffalo/packd v1.0.1 // indirect
8281
github.com/gobuffalo/packr v1.30.1 // indirect
83-
github.com/gogo/protobuf v1.3.2 // indirect
8482
github.com/golang/mock v1.6.0 // indirect
8583
github.com/google/certificate-transparency-go v1.0.21 // indirect
86-
github.com/google/go-cmp v0.6.0 // indirect
84+
github.com/google/go-cmp v0.7.0 // indirect
8785
github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect
8886
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
8987
github.com/hashicorp/hcl v1.0.0 // indirect
@@ -94,29 +92,31 @@ require (
9492
github.com/joho/godotenv v1.4.0 // indirect
9593
github.com/josharian/intern v1.0.0 // indirect
9694
github.com/kilic/bls12-381 v0.1.0 // indirect
97-
github.com/klauspost/compress v1.17.4 // indirect
98-
github.com/magiconair/properties v1.8.7 // indirect
95+
github.com/klauspost/compress v1.18.0 // indirect
96+
github.com/magiconair/properties v1.8.10 // indirect
9997
github.com/mailru/easyjson v0.7.7 // indirect
10098
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
10199
github.com/miekg/pkcs11 v1.1.1 // indirect
102100
github.com/mitchellh/mapstructure v1.4.3 // indirect
103101
github.com/mmcloughlin/addchain v0.4.0 // indirect
104102
github.com/moby/docker-image-spec v1.3.1 // indirect
103+
github.com/moby/go-archive v0.1.0 // indirect
105104
github.com/moby/patternmatcher v0.6.0 // indirect
106-
github.com/moby/sys/sequential v0.5.0 // indirect
107-
github.com/moby/sys/user v0.1.0 // indirect
105+
github.com/moby/sys/sequential v0.6.0 // indirect
106+
github.com/moby/sys/user v0.4.0 // indirect
107+
github.com/moby/sys/userns v0.1.0 // indirect
108108
github.com/moby/term v0.5.0 // indirect
109109
github.com/morikuni/aec v1.0.0 // indirect
110110
github.com/nxadm/tail v1.4.8 // indirect
111111
github.com/opencontainers/go-digest v1.0.0 // indirect
112-
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
112+
github.com/opencontainers/image-spec v1.1.1 // indirect
113113
github.com/pelletier/go-toml v1.9.5 // indirect
114114
github.com/pmezard/go-difflib v1.0.0 // indirect
115115
github.com/prometheus/client_golang v1.17.0 // indirect
116116
github.com/prometheus/client_model v0.5.0 // indirect
117117
github.com/prometheus/common v0.44.0 // indirect
118118
github.com/prometheus/procfs v0.12.0 // indirect
119-
github.com/rogpeppe/go-internal v1.11.0 // indirect
119+
github.com/rogpeppe/go-internal v1.13.1 // indirect
120120
github.com/sirupsen/logrus v1.9.3 // indirect
121121
github.com/spf13/afero v1.6.0 // indirect
122122
github.com/spf13/cast v1.4.1 // indirect
@@ -133,17 +133,18 @@ require (
133133
github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb // indirect
134134
go.uber.org/multierr v1.11.0 // indirect
135135
go.uber.org/zap v1.25.0 // indirect
136-
golang.org/x/crypto v0.22.0 // indirect
136+
golang.org/x/crypto v0.48.0 // indirect
137137
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
138-
golang.org/x/mod v0.13.0 // indirect
139-
golang.org/x/net v0.24.0 // indirect
140-
golang.org/x/sys v0.19.0 // indirect
141-
golang.org/x/text v0.14.0 // indirect
142-
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
143-
google.golang.org/grpc v1.59.0 // indirect
138+
golang.org/x/mod v0.32.0 // indirect
139+
golang.org/x/net v0.50.0 // indirect
140+
golang.org/x/sys v0.41.0 // indirect
141+
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 // indirect
142+
golang.org/x/text v0.34.0 // indirect
143+
golang.org/x/tools/go/expect v0.1.1-deprecated // indirect
144+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
145+
google.golang.org/grpc v1.78.0 // indirect
144146
gopkg.in/ini.v1 v1.67.0 // indirect
145147
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
146148
gopkg.in/yaml.v3 v3.0.1 // indirect
147-
gotest.tools/v3 v3.5.1 // indirect
148149
rsc.io/tmplfunc v0.0.3 // indirect
149150
)

0 commit comments

Comments
 (0)