diff --git a/CHANGELOG.md b/CHANGELOG.md index 0432f7e..4483265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,72 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 0.6.0 -- Enable the 'skip_empty_output' instruction in all maps and stores by default, unless the macro is called with the keep_empty_output parameter, like this: +### List of changes +- Enabled the 'skip_empty_output' instruction in all maps and stores by default, unless the macro is called with the keep_empty_output parameter, like this: `#[substreams::handlers::map(keep_empty_output)]` +- Bumped the `prost` dependencies from 0.11 to 0.13.3 + +### Upgrading your substreams project + +Because of code generated by "buf neoeinstein-prost" plugin and since Rust allows multiple versions of a dependency to be loaded, but we export public functions to the wasm interface, it is very important to align all the dependencies that may depend on this substreams library. + +Here are the changes that you must perform in your substreams project to upgrade to v0.6.0: + +1. in `buf.gen.yaml` + * bump `buf.build/community/neoeinstein-prost:v0.4.0` + * bump `buf.build/community/neoeinstein-prost-crate:v0.4.1` + +2. in `Cargo.toml`, update the dependencies/build_deps only for the modules that you already have: + * bump `substreams = "0.6"` + * bump `prost = "0.13"` + * bump `prost-types = "0.13"` + * bump `prost-build = "0.13"` + * bump `substreams-ethereum = "0.10"` + * bump `substreams-antelope = "0.6"` + * bump `substreams-database-change = "2"` + * bump `substreams-entity-change = "2"` + +3. Run `substreams build` again + +### Debugging errors after the upgrade + +#### Unimplemented prost::message::Message + +``` +10 | #[substreams::handlers::map] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `prost::message::Message` is not implemented for `MyData` +``` + +This means that you have a mismatch between the generated protobuf bindings (usually generated by the buf `neoinstein-prost` and `neoinstein-prost-crate` plugins) and the `prost`/`prost-types`/`prost-build` version in one of your Cargo.toml. Make sure that your buf.gen.yaml file exists and points to the versions specified above, as well as the versions for prost libraries in every Cargo.toml. + +#### Two different versions of crate being used + +``` +error[E0308]: mismatched types + --> src/lib.rs:17:36 + | +17 | my_data.block_timestamp = Some(blk.timestamp().to_owned()); + | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Timestamp`, found `prost_types::protobuf::Timestamp` + | | + | arguments to this enum variant are incorrect + | + = note: `prost_types::protobuf::Timestamp` and `Timestamp` have similar names, but are actually distinct types +note: `prost_types::protobuf::Timestamp` is defined in crate `prost_types` + --> /Users/you/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-types-0.11.9/src/protobuf.rs:2296:1 + | +2296 | pub struct Timestamp { + | ^^^^^^^^^^^^^^^^^^^^ +note: `Timestamp` is defined in crate `prost_types` + --> /Users/you/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-types-0.13.3/src/protobuf.rs:2253:1 + | +2253 | pub struct Timestamp { + | ^^^^^^^^^^^^^^^^^^^^ + = note: perhaps two different versions of crate `prost_types` are being used? +``` + +This means that one of your dependencies uses the wrong version of prost-types (0.11.9 in this example). You probably forgot to bump a dependency in one of your Cargo.toml, for example substreams-ethereum or substreams-antelope. ## 0.5.22 diff --git a/Cargo.lock b/Cargo.lock index 0fd919e..3c15674 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -280,12 +280,6 @@ dependencies = [ "either", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" version = "0.2.154" @@ -345,9 +339,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.14.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "pad" @@ -445,6 +439,16 @@ dependencies = [ "syn 1.0.100", ] +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.61", +] + [[package]] name = "proc-macro2" version = "1.0.82" @@ -456,9 +460,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -466,44 +470,44 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", "heck", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", + "prettyplease 0.2.20", "prost", "prost-types", "regex", + "syn 2.0.61", "tempfile", - "which", ] [[package]] name = "prost-derive" -version = "0.11.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.100", + "syn 2.0.61", ] [[package]] name = "prost-types" -version = "0.11.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" dependencies = [ - "bytes", "prost", ] @@ -635,7 +639,7 @@ dependencies = [ [[package]] name = "substreams" -version = "0.5.22" +version = "0.6.0" dependencies = [ "anyhow", "bigdecimal", @@ -657,10 +661,10 @@ dependencies = [ [[package]] name = "substreams-macro" -version = "0.5.22" +version = "0.6.0" dependencies = [ "pretty_assertions", - "prettyplease", + "prettyplease 0.1.25", "proc-macro2", "quote", "syn 1.0.100", @@ -753,17 +757,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "which" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 5039925..e2842d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ members = [ ] [workspace.package] -version = "0.5.22" +version = "0.6.0" description = "Substreams SDK - A streaming data engine for The Graph - by StreamingFast" edition = "2018" homepage = "https://substreams.streamingfast.io/" @@ -17,7 +17,7 @@ categories = ["api-bindings", "external-ffi-bindings", "wasm"] rust-version = "1.60" [workspace.dependencies] -substreams-macro = { version = "0.5.22", path = "./substreams-macro" } +substreams-macro = { version = "0.6.0", path = "./substreams-macro" } [profile.release] lto = true diff --git a/substreams/Cargo.toml b/substreams/Cargo.toml index ecdf68a..f250e4f 100644 --- a/substreams/Cargo.toml +++ b/substreams/Cargo.toml @@ -20,8 +20,8 @@ num-bigint = "0.4" num-traits = "0.2" num-integer = "0.1.45" pad = "0.1" -prost = "0.11" -prost-types = "0.11" +prost = "0.13.3" +prost-types = "0.13.3" substreams-macro = { workspace = true } thiserror = "1" pest= "2.7.10" @@ -31,4 +31,4 @@ pest_derive = "2.7.10" rstest = "0.19.0" [build-dependencies] -prost-build = "0.11" +prost-build = "0.13.3"