Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
]

[workspace.package]
version = "0.32.0"
version = "0.33.0"
edition = "2021"
authors = ["The Graph core developers & contributors"]
readme = "README.md"
Expand Down
43 changes: 43 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@

## Unreleased

## v0.33.0

### What's New

- **Arweave file data sources** - Arweave file data sources allow subgraph developers to access offchain data from Arweave from within the subgraph mappings.[(#4789)](https://github.com/graphprotocol/graph-node/pull/4789)
- **Major performance boost for substreams-based subgraphs** - Significant performance improvements have been achieved for substreams-based subgraphs by moving substreams processing to the block stream.[(#4851)](https://github.com/graphprotocol/graph-node/pull/4851)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mangas do you have an estimate of the size of the boost?

- **Polling block handler** - A new block handler filter `polling` for `ethereum` data sources which enables subgraph developers to run a block handler at defined block intervals. This is useful for use cases such as taking periodic snapshots of the contract state.[(#4725)](https://github.com/graphprotocol/graph-node/pull/4725)
- **Initialization handler** - A new block handler filter `once` for `ethereum` data sources which enables subgraph developers to create a handler which will be called only once before all other handlers run. This configuration allows the subgraph to use the handler as an initialization handler, performing specific tasks at the start of indexing. [(#4725)](https://github.com/graphprotocol/graph-node/pull/4725)
- **DataSourceContext in manifest** - `DataSourceContext` in Manifest - DataSourceContext can now be defined in the subgraph manifest. It's a free-form map accessible from the mapping. This feature is useful for templating chain-specific data in subgraphs that use the same codebase across multiple chains.[(#4848)](https://github.com/graphprotocol/graph-node/pull/4848)
- `graph-node` version in index node API - The Index Node API now features a new query, Version, which can be used to query the current graph-node version and commit. [(#4852)](https://github.com/graphprotocol/graph-node/pull/4852)
- Added a '`paused`' field to Index Node API, a boolean indicating the subgraph’s pause status. [(#4779)](https://github.com/graphprotocol/graph-node/pull/4779)
- Proof of Indexing logs now include block number [(#4798)](https://github.com/graphprotocol/graph-node/pull/4798)
- `subgraph_features` table now tracks details about handlers used in a subgraph [(#4820)](https://github.com/graphprotocol/graph-node/pull/4820)
- Configurable SSL for Postgres in Dockerfile - ssl-mode for Postgres can now be configured via the connection string when deploying through Docker, offering enhanced flexibility in database security settings.[(#4840)](https://github.com/graphprotocol/graph-node/pull/4840)
- Introspection Schema Update - The introspection schema has been updated to align with the October 2021 GraphQL specification update.[(#4676)](https://github.com/graphprotocol/graph-node/pull/4676)
- `trace_id` Added to Substreams Logger [(#4868)](https://github.com/graphprotocol/graph-node/pull/4868)
- New apiVersion for Mapping Validation - The latest apiVersion 0.0.8 validates that fields set in entities from the mappings are actually defined in the schema. This fixes a source of non-deterministic PoI. Subgraphs using this new API version will fail if they try to set undefined schema fields in the mappings. Its strongly recommended updating to 0.0.8 to avoid these issues. [(#4894)](https://github.com/graphprotocol/graph-node/pull/4894)
- Substreams Block Ingestor Support - Added the ability to run a pure substreams chain by introducing a block ingestor for substreams-only chains. This feature allows users to run a chain with just a single substreams endpoint, enhancing support beyond RPC and firehose. Prior to this, a pure substreams chain couldn’t be synced.[(#4839)](https://github.com/graphprotocol/graph-node/pull/4839)

### Bug fixes

- Fix for rewinding dynamic data source - Resolved an issue where a rewind would fail to properly remove dynamic data sources when using `graphman rewind`. This has been fixed to ensure correct behavior.[(#4810)](https://github.com/graphprotocol/graph-node/pull/4810)
- Improved Deployment Reliability with Retry Mechanism - A retry feature has been added to the block_pointer_from_number function to enhance the robustness of subgraph deployments. This resolves occasional failures encountered during deployment processes.[(#4812)](https://github.com/graphprotocol/graph-node/pull/4812)
- Fixed Cross-Shard Grafting Issue - Addressed a bug that prevented cross-shard grafting from starting, causing the copy operation to stall at 0% progress. This issue occurred when a new shard was added after the primary shard had already been configured. The fix ensures that foreign tables and schemas are correctly set up in new shards. For existing installations experiencing this issue, it can be resolved by running `graphman database remap`.[(#4845)](https://github.com/graphprotocol/graph-node/pull/4845)
- Fixed a Full-text search regression - Reverted a previous commit (ad1c6ea) that inadvertently limited the number of populated search indexes per entity.[(#4808)](https://github.com/graphprotocol/graph-node/pull/4808)
- Attestable Error for Nested Child Filters - Nested child filter queries now return an attestable `ChildFilterNestingNotSupportedError`, improving error reporting for users.[(#4828)](https://github.com/graphprotocol/graph-node/pull/4828)

### Graphman
- **Index on prefixed fields** - The graphman index create command now correctly indexes prefixed fields of type String and Bytes for more query-efficient combined indexes. Note: For fields that are references to entities, the behavior may differ. The command may create an index using left(..) when it should index the column directly.
- **Partial Indexing for Recent Blocks** - The graphman index create command now includes a `--after $recent_block` flag for creating partial indexes focused on recent blocks. This enhances query performance similar to the effects of pruning. Queries using these partial indexes must include a specific clause for optimal performance.[(#4830)](https://github.com/graphprotocol/graph-node/pull/4830)

<!--
Not Relevant
* Changes the spelling of History from Hostory by @vishal-sys in https://github.com/graphprotocol/graph-node/pull/4846
* Test coverage for bundlr manifest + filename use case by @mangas in https://github.com/graphprotocol/graph-node/pull/4865
* Revert most of PR 4827 by @lutter in https://github.com/graphprotocol/graph-node/pull/4860
* Pass polling triggers only after start_block by @incrypto32 in https://github.com/graphprotocol/graph-node/pull/4881
* Remove the entry from `subgraph_features` table when a subgraph is removed by @incrypto32 in https://github.com/graphprotocol/graph-node/pull/4811
* Update docker-compose.yml by @computeronix in https://github.com/graphprotocol/graph-node/pull/4844
-->

**Full Changelog**: https://github.com/graphprotocol/graph-node/compare/v0.33.0...e253ee14cda2d8456a86ae8f4e3f74a1a7979953

## v0.32.0

### What's New
Expand Down
11 changes: 0 additions & 11 deletions graph/src/data/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,6 @@ impl<E, T: IntoIterator<Item = Result<(Word, Value), E>>> TryIntoEntityIterator<

#[derive(Debug, Error, PartialEq, Eq, Clone)]
pub enum EntityValidationError {
#[error("The provided entity has fields not defined in the schema for entity `{entity}`")]
FieldsNotDefined { entity: String },

#[error("Entity {entity}[{id}]: unknown entity type `{entity}`")]
UnknownEntityType { entity: String, id: String },

Expand Down Expand Up @@ -918,14 +915,6 @@ impl Entity {
}
})?;

for field in self.0.atoms() {
if !key.entity_type.has_field(field) {
return Err(EntityValidationError::FieldsNotDefined {
entity: key.entity_type.to_string(),
});
}
}

for field in &object_type.fields {
let is_derived = field.is_derived();
match (self.get(&field.name), is_derived) {
Expand Down
3 changes: 3 additions & 0 deletions graph/src/data/subgraph/api_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub const API_VERSION_0_0_6: Version = Version::new(0, 0, 6);
/// Enables event handlers to require transaction receipts in the runtime.
pub const API_VERSION_0_0_7: Version = Version::new(0, 0, 7);

/// Enables validation for fields that doesnt exist in the schema for an entity.
pub const API_VERSION_0_0_8: Version = Version::new(0, 0, 8);

/// Before this check was introduced, there were already subgraphs in the wild with spec version
/// 0.0.3, due to confusion with the api version. To avoid breaking those, we accept 0.0.3 though it
/// doesn't exist.
Expand Down
4 changes: 2 additions & 2 deletions graph/src/env/mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct EnvVarsMapping {
/// kilobytes). The default value is 10 megabytes.
pub entity_cache_size: usize,
/// Set by the environment variable `GRAPH_MAX_API_VERSION`. The default
/// value is `0.0.7`.
/// value is `0.0.8`.
pub max_api_version: Version,
/// Set by the environment variable `GRAPH_MAPPING_HANDLER_TIMEOUT`
/// (expressed in seconds). No default is provided.
Expand Down Expand Up @@ -93,7 +93,7 @@ pub struct InnerMappingHandlers {
entity_cache_dead_weight: EnvVarBoolean,
#[envconfig(from = "GRAPH_ENTITY_CACHE_SIZE", default = "10000")]
entity_cache_size_in_kb: usize,
#[envconfig(from = "GRAPH_MAX_API_VERSION", default = "0.0.7")]
#[envconfig(from = "GRAPH_MAX_API_VERSION", default = "0.0.8")]
max_api_version: Version,
#[envconfig(from = "GRAPH_MAPPING_HANDLER_TIMEOUT")]
mapping_handler_timeout_in_secs: Option<u64>,
Expand Down
2 changes: 1 addition & 1 deletion graph/src/schema/entity_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use super::{input_schema::POI_OBJECT, EntityKey, InputSchema};
#[derive(Clone)]
pub struct EntityType {
schema: InputSchema,
atom: Atom,
pub atom: Atom,
}

impl EntityType {
Expand Down
8 changes: 8 additions & 0 deletions graph/src/schema/input_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,14 @@ impl InputSchema {
)
})
}
pub fn has_field_with_name(&self, entity_type: &EntityType, field: &str) -> bool {
let field = self.inner.pool.lookup(field);

match field {
Some(field) => self.has_field(entity_type.atom, field),
None => false,
}
}
}

/// Create a new pool that contains the names of all the types defined
Expand Down
Loading