Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update rust crate substreams to 0.6 - autoclosed #1814

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 11, 2024

This PR contains the following updates:

Package Type Update Change
substreams (source) dependencies minor 0.5 -> 0.6

Release Notes

streamingfast/substreams-rs (substreams)

v0.6.0

Compare Source

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
  1. 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"
  1. 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.

Symbol multiply defined
warning: Linking globals named 'alloc': symbol multiply defined!

error: failed to load bitcode of module "substreams-cc542fa47b990c4e.substreams.f89693ec9899ca95-cgu.05.rcgu.o": 

warning: `my_project` (lib) generated 1 warning
error: could not compile `my_project` (lib) due to 1 previous error; 1 warning emitted

This means that the this module (substreams) is linked many times with different versions. This is invalid because of the global exports, make sure that only the version 0.6.0 of substreams-rs is used by any of your dependencies.

v0.5.22

Compare Source

  • Added ExprMatcher, and constructor(s) expr_matcher and ExprMatcher::new. This can be used to parse an expression once and re-used it to run multiple matches_keys against different keys:

      let matcher = substreams::expr_matcher(&query);
    
      transactions.flat_map(|trx| {
          trx.instructions()
              .filter(|view| matcher.matches_keys(&vec![format!("program:{}", view.program_id().to_string())]))
      });

v0.5.21

Compare Source

  • Add skip_empty_output intrinsic (requires substreams server version v1.9.0 or later)

v0.5.20

Compare Source

  • Accepts - character in expression's parsing expect at the beginning of the expression. (Ex: -test is failing, test-8 is not)

v0.5.19

Compare Source

  • The return of store type StoreSetSum which allows both summing and setting a value in a store. This is useful for storing aggregated values in a store. Note: to read deltas from this store, you will need to use the Deltas type. The delta values will come prefixed with "set:" or "sum:" depending on the operation, followed by the string representation of the value. It is up to the user to decode the values as necessary.

v0.5.18

Compare Source

  • Accept all characters within index keys except -,', ", &&, ||, ), ( and spaces of all kind.

v0.5.17

Compare Source

  • Removed StoreSetSum. (Reverted changes from 0.5.16 and 0.5.15)

v0.5.16

Compare Source

  • Add StoreSetSum to the WRITABLE_STORE array

v0.5.15

Compare Source

  • Add new store type StoreSetSum which allows both summing and setting a value in a store. This is useful for storing aggregated values in a store.

v0.5.14

Compare Source

  • Add index keys protobuf in substreams crate
  • Add matches_keys_in_parsed_expr function returning a bool. It returns true, if the set of keys provided, matches the expression.
    (Ex: expression: (key1 || key2), if the set of keys contains key1 or contains key2, matches_keys_in_parsed_expr(keys, expression) returns true, else returns false)

v0.5.13

Compare Source

Added support for specifying let mut <param>: <Type> when using the #[substreams::handlers::map] macros, this enables in-place trimming of received data.

v0.5.12

Compare Source

Added back some lost binary operations on BigInt like BigInt - BigInt for example.

v0.5.11

Compare Source

Highlights

In this release we add further arithmetics and logics operators possibilities on BigInt type, namely:

  • BitAnd
  • BitAndAssign
  • BitOr
  • BitOrAssign
  • BitXor
  • Rem
  • Pow
  • Shl
  • ShlAssign
  • ShrAssign

The BigInt now also has a new method div_rem that performs division by another BigInt and returns the quotient and the remainder.

We also improved error messages on a variety of error cases for example BigInt::to_u32 and BigInt::to_u64 will now print a much more useful message that should make it clear that the value is too big.

Changed
  • Removed all internal usage of .unwrap() and replaced them with .expect(<message>) or .unwrap_or_else(|| panic!(<message>)) improving the error message on different edge cases that can happen from time to time.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Dec 11, 2024
Copy link
Contributor Author

renovate bot commented Dec 11, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: examples/substreams-powered-subgraph/Cargo.lock
Command failed: cargo update --config net.git-fetch-with-cli=true --manifest-path examples/substreams-powered-subgraph/Cargo.toml --package [email protected] --precise 0.6.0
    Updating crates.io index
error: failed to select a version for the requirement `substreams = "^0.5"`
candidate versions found which didn't match: 0.6.0
location searched: crates.io index
required by package `substreams-entity-change v1.3.0`
    ... which satisfies dependency `substreams-entity-change = "^1.3"` (locked to 1.3.0) of package `substreams-ethereum-quickstart v1.0.0 (/tmp/renovate/repos/github/graphprotocol/graph-tooling/examples/substreams-powered-subgraph)`

Copy link

changeset-bot bot commented Dec 11, 2024

⚠️ No Changeset found

Latest commit: 9ce56c0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

Deploying graph-tooling with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ce56c0
Status:🚫  Build failed.

View logs

Copy link
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphprotocol/graph-cli 0.92.0-alpha-20241211045025-9ce56c0b9a20c62272ae4eccb514bb7fd87ebc01 npm ↗︎ unpkg ↗︎
@graphprotocol/graph-ts 0.37.0-alpha-20241211045025-9ce56c0b9a20c62272ae4eccb514bb7fd87ebc01 npm ↗︎ unpkg ↗︎

@renovate renovate bot changed the title fix(deps): update rust crate substreams to 0.6 fix(deps): update rust crate substreams to 0.6 - autoclosed Dec 13, 2024
@renovate renovate bot closed this Dec 13, 2024
@renovate renovate bot deleted the renovate/substreams-0.x branch December 13, 2024 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants