diff --git a/.github/workflows/buf-pull-request.yml b/.github/workflows/buf-pull-request.yml index 37ca86722e..6772e52e04 100644 --- a/.github/workflows/buf-pull-request.yml +++ b/.github/workflows/buf-pull-request.yml @@ -26,10 +26,10 @@ jobs: shell: bash run: | cd proto/penumbra - buf mod update + buf dep update s="$(git status --porcelain)" if [[ -n "$s" ]]; then - echo "ERROR: run 'buf mod update' to synchronize buf.lock" + echo "ERROR: run 'buf dep update' to synchronize buf.lock" echo "$s" exit 1 else diff --git a/deployments/scripts/protobuf-codegen b/deployments/scripts/protobuf-codegen index 5c16ebd908..2765293cb0 100755 --- a/deployments/scripts/protobuf-codegen +++ b/deployments/scripts/protobuf-codegen @@ -16,7 +16,7 @@ done echo "Pulling proto dependencies from BSR..." pushd "${repo_root}/proto/" # Make sure the lockfile is up to date. -buf mod update penumbra +buf dep update penumbra # Pull our vendored cosmos/IBC proto defs so we can get reflection for service definitions. # The penumbra dependencies will override some of these. diff --git a/docs/guide/src/dev/protobuf.md b/docs/guide/src/dev/protobuf.md index 57b87b4aa4..0ac194a9dc 100644 --- a/docs/guide/src/dev/protobuf.md +++ b/docs/guide/src/dev/protobuf.md @@ -36,7 +36,7 @@ The `buf` tool is required to update lockfiles used for version management in the [Buf Schema Registry](https://buf.build/penumbra-zone/penumbra). Visit the [buf download page](https://buf.build/docs/installation/) to obtain a version. After installing, run `buf --version` and confirm you're running at least -`1.27.0` (or newer). +`1.32.0` (or newer). ## Building protos @@ -62,7 +62,7 @@ We should review these deps periodically and bump them, as we would any other de ```shell cd proto/penumbra # edit buf.yaml to remove the tags, i.e. suffix `:` -buf mod update +buf dep update ``` Then commit and PR in the results. diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 086c2eec93..171c86699b 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -1,11 +1,13 @@ -version: v1 +version: v2 managed: enabled: true - go_package_prefix: - default: github.com/penumbra-zone/penumbra/proto/go/gen - except: - - buf.build/cosmos/ibc + disable: + - file_option: go_package + module: buf.build/cosmos/ibc + override: + - file_option: go_package_prefix + value: github.com/penumbra-zone/penumbra/proto/go/gen plugins: - - plugin: buf.build/protocolbuffers/go + - remote: buf.build/protocolbuffers/go out: go/gen opt: paths=source_relative diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 0000000000..a29f6d366e --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,21 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/cosmos/cosmos-proto + commit: 1935555c206d4afb9e94615dfd0fad31 + digest: b5:0a29584117fe6433fa593d03fbda6b3964ddc59b986cd2277833ee01d4ac215a14b0286241462cd0dee6b460a108823dff5c7c42c9c1f4f7df861fcfa4bbebdf + - name: buf.build/cosmos/cosmos-sdk + commit: e7a85cef453e4b999ad9aff8714ae05f + digest: b5:78173376f272d38369c9e503118643f068b44a4f48c268a4a4e7af5a35807364ba52397ff5ed72e1ce18042df0d7cd757e7f862d429ccb844bd8bd7f8d0ab72b + - name: buf.build/cosmos/gogo-proto + commit: 34d970b699f84aa382f3c29773a60836 + digest: b5:15d77a039fd9ab81ffb28ce9601eeb687840474dd11cf645341d50c1bba7f70b01acdf0e9781d09d42d0e4bcb720eac96451827b6cf24146e2a6b2bb3d65a96c + - name: buf.build/cosmos/ibc + commit: 7ab44ae956a0488ea04e04511efa5f70 + digest: b5:17407a9bf53b990c5d362bc9bd357931aeb8516c1393b1de79823e09bcecc3c8217e0546d5be897599da6a60499bdda1bcf950eca6c4bad4209b98c937e725f1 + - name: buf.build/cosmos/ics23 + commit: 55085f7c710a45f58fa09947208eb70b + digest: b5:ab3cb4080c6974b1dd378d3e5602ae86ab7396dff1f4f25c5298c9827519ef0329e4be0e4f5f2d8cf61b1925f0c627cdfcf64955414c453036be05cab56994f0 + - name: buf.build/googleapis/googleapis + commit: 75b4300737fb4efca0831636be94e517 + digest: b5:d227a018d00bd477f62a1b3f394c87c142f7429b8bf046f7d5e6a1bb3d0e5293a96491d50825983683c295f038cdace614d258a083baa5f766985c9e618c5d2a diff --git a/proto/buf.work.yaml b/proto/buf.work.yaml deleted file mode 100644 index 7c61c8468d..0000000000 --- a/proto/buf.work.yaml +++ /dev/null @@ -1,3 +0,0 @@ -version: v1 -directories: - - penumbra diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 0000000000..805f75f7e8 --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,20 @@ +version: v2 +modules: + - path: penumbra + name: buf.build/penumbra-zone/penumbra +deps: + - buf.build/cosmos/cosmos-sdk:e7a85cef453e4b999ad9aff8714ae05f + - buf.build/cosmos/ibc:7ab44ae956a0488ea04e04511efa5f70 +lint: + use: + - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/proto/penumbra/buf.lock b/proto/penumbra/buf.lock deleted file mode 100644 index 10a3ab205e..0000000000 --- a/proto/penumbra/buf.lock +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: cosmos - repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 - digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 - - remote: buf.build - owner: cosmos - repository: cosmos-sdk - commit: e7a85cef453e4b999ad9aff8714ae05f - digest: shake256:bc5f340b60991981d8aabefcc9c706780e25fa0d3ab7e1d9a3e75559f45c80038a913d05aa51928ad8dfebeee75feea1dc6e0e7a6311302e60c42fb3596ee262 - - remote: buf.build - owner: cosmos - repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 - digest: shake256:3d3bee5229ba579e7d19ffe6e140986a228b48a8c7fe74348f308537ab95e9135210e81812489d42cd8941d33ff71f11583174ccc5972e86e6112924b6ce9f04 - - remote: buf.build - owner: cosmos - repository: ibc - commit: 7ab44ae956a0488ea04e04511efa5f70 - digest: shake256:95cc5472ddf692d23654b7e5adfd79149469dcc90657f9a1f80ee3fea8af639cff59cd849efca0567d270118eea7c7ff2f7e60c562545bace410b8eece27577e - - remote: buf.build - owner: cosmos - repository: ics23 - commit: 55085f7c710a45f58fa09947208eb70b - digest: shake256:9bf0bc495b5a11c88d163d39ef521bc4b00bc1374a05758c91d82821bdc61f09e8c2c51dda8452529bf80137f34d852561eacbe9550a59015d51cecb0dacb628 - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 - digest: shake256:d865f55b8ceb838c90c28b09894ab43d07f42551108c23760004a6a4e28fe24d3a1f7380a3c9278edb329a338a9cc5db8ad9f394de548e70d534e98504972d67 diff --git a/proto/penumbra/buf.yaml b/proto/penumbra/buf.yaml deleted file mode 100644 index 3f40887723..0000000000 --- a/proto/penumbra/buf.yaml +++ /dev/null @@ -1,18 +0,0 @@ -version: v1 -name: buf.build/penumbra-zone/penumbra -# We pin versions of the upstream cosmos deps, to avoid the chore of bumping -# the lockfile regularly, while still detecting uncommitted changes to our -# protos in CI. -deps: - # https://buf.build/cosmos/ibc/docs/7ab44ae956a0488ea04e04511efa5f70, 2023-09-13 - - buf.build/cosmos/ibc:7ab44ae956a0488ea04e04511efa5f70 - # cosmos-sdk 9d547dbea90f47afbe1898388fcebffb, 2023-05-31, breaks the build, requiring - # attributes 'extension' and 'extension_signature' on 'proto::tendermint::types::Vote'. - # https://buf.build/cosmos/cosmos-sdk/docs/e7a85cef453e4b999ad9aff8714ae05f, 2023-05-22 - - buf.build/cosmos/cosmos-sdk:e7a85cef453e4b999ad9aff8714ae05f -breaking: - use: - - FILE -lint: - use: - - DEFAULT