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

Feature Management and Validation #2682

Merged
merged 56 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0be0a6b
core, graph, graphql: Rename nonFatalErrors to UpperCamelCase
tilacog Jul 19, 2021
08df010
graph: use a dedicated `features` module
tilacog Jul 19, 2021
73ef10c
graph: use serde_plain to impl Display/FromStr
tilacog Jul 20, 2021
8f23428
graph: [WIP] function outline
tilacog Jul 21, 2021
9d58f33
graph: Module documentation, new Error type and public fn layout
tilacog Jul 21, 2021
622cfc8
graph: [WIP] working on `validate_subgraph_features` function
tilacog Jul 21, 2021
c07448a
Don't handle possibility of duplication
tilacog Jul 22, 2021
d3139c8
graph: dedect full text search. [WIP] Error propagation.
tilacog Jul 23, 2021
bed6175
graph: Detect nonFatalErrors
tilacog Jul 23, 2021
ac8d071
graph: detect grafting
tilacog Jul 23, 2021
19ec385
graph: detect IpfsOnEthereumContracts
tilacog Jul 23, 2021
f6cddc6
graph: Remove error propagation. Detect fullTextSearch.
tilacog Jul 23, 2021
f22a1b4
graph: Use constants to store IPFS host function names
tilacog Jul 23, 2021
3579d49
server: Update GraphQL schema
tilacog Jul 26, 2021
19608c6
graph: Refactor feature detection functions
tilacog Jul 27, 2021
50c737d
server: [WIP] subgraph feature route
tilacog Jul 27, 2021
0045713
node, server: [WIP]: Pass IpfsLinkResolver to IndexNodeResolver
tilacog Jul 28, 2021
9b298c9
server: Build deployment hash value
tilacog Jul 28, 2021
2c03a50
server: Resolve an unvalidated subgraph
tilacog Jul 28, 2021
b6a37b2
graph, server: block_on resolution, new query error variant
tilacog Jul 28, 2021
6d39543
server: [WIP] failed attempt to validate subgraph manifest
tilacog Jul 29, 2021
4569635
graph, node, server: [WIP] pass subgraph store to index resolver
tilacog Jul 29, 2021
4cfed07
server: Build response object
tilacog Jul 29, 2021
b9e0ab0
server: refactor future handling
tilacog Jul 29, 2021
66eb17e
server: comments
tilacog Jul 30, 2021
41153d8
server: [WIP] update TODOs
tilacog Jul 30, 2021
a98e700
server: Refactor resolve_subgrahp_features function
tilacog Aug 3, 2021
741c7fd
server: Don't try to use database as a cache (for now)
tilacog Aug 3, 2021
e7d1ee7
graph: Add validation step that checks for undeclared features
tilacog Aug 3, 2021
601f92c
server: Refactor subgraph feature validation in graphql endpoint
tilacog Aug 12, 2021
68e3c21
server: Update return type
tilacog Aug 4, 2021
02a7bda
chain, graph, graphq, store: Use Version type for specVersion
tilacog Aug 12, 2021
56ea53d
graph: Introduce specVersion 0.0.4 as the new MAX_VERSION
tilacog Aug 4, 2021
9485f6d
graph: Condition subgraph feature validation to specVersion >= 0.0.4
tilacog Aug 4, 2021
36a6004
graph: Let MAX_SPEC_VERISION be optionally defined by an env var
tilacog Aug 19, 2021
f410595
graph: Tests for camelCase serialization and deserialization
tilacog Aug 5, 2021
29972be
chain: Unit tests for feature validation [on manifest only]
tilacog Aug 6, 2021
ef677ee
chain: Test NonFatalErrors feature detection
tilacog Aug 6, 2021
1123793
chain: Unit tests for fullTextSearch feature
tilacog Aug 6, 2021
2e068ef
chain: Test ipfsOnEthereumContracts feature
tilacog Aug 9, 2021
4872b1d
server: Update graphql schema to not use null lists
tilacog Aug 9, 2021
b5140cd
graph, server: Restrict endpiont for specVersions inferior to 0.0.4
tilacog Aug 10, 2021
7066f0e
chain: Refactor `include_bytes` to be a constant
tilacog Aug 10, 2021
1b2771a
chain: Move consts to the top
tilacog Aug 10, 2021
9fbcbb2
chain, graph, runtime, server: Remove unwrap from mapping detection
tilacog Aug 12, 2021
7c97d70
crate: Update Cargo.lock
tilacog Aug 12, 2021
b37de58
graph: Remove line break from error message
tilacog Aug 12, 2021
16607b9
ci: Update environment variable
tilacog Aug 12, 2021
833964a
runtime: Use wasm_file_path helper function
tilacog Aug 12, 2021
48c0c11
graph: Update documentation
tilacog Aug 12, 2021
fe2e476
chain: Bubble-up Result value instead of unwrapping
tilacog Aug 19, 2021
166c3c0
server: Handle the possibility of an empty validation error set
tilacog Aug 19, 2021
54ddbaf
graph, runtime: Document the coupling of IPFS host-export functions
tilacog Aug 19, 2021
f9aab43
graph, server: Typo in comments
tilacog Aug 19, 2021
9b2919d
chain, server: Allow feature detection for specVersion < 0.0.4
tilacog Aug 19, 2021
349cbb2
Update Cargo.lock
tilacog Aug 19, 2021
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
THEGRAPH_STORE_POSTGRES_DIESEL_URL: "postgresql://postgres:postgres@localhost:5432/graph_node_test"
GRAPH_MAX_SPEC_VERSION: "0.0.4"

jobs:
unit-tests:
Expand Down
99 changes: 57 additions & 42 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion chain/ethereum/src/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ impl_slog_value!(NodeCapabilities, "{}");
impl graph::blockchain::NodeCapabilities<crate::Chain> for NodeCapabilities {
fn from_data_sources(data_sources: &[DataSource]) -> Self {
NodeCapabilities {
archive: data_sources.iter().any(|ds| ds.mapping.requires_archive()),
archive: data_sources.iter().any(|ds| {
ds.mapping
.requires_archive()
.expect("failed to parse mappings")
tilacog marked this conversation as resolved.
Show resolved Hide resolved
}),
traces: data_sources.into_iter().any(|ds| {
ds.mapping.has_call_handler() || ds.mapping.has_block_handler_with_call_filter()
}),
Expand Down
3 changes: 2 additions & 1 deletion chain/ethereum/src/network_indexer/subgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::Chain;

use super::*;
use futures::future::FutureResult;
use semver::Version;
use std::{collections::BTreeSet, marker::PhantomData};

fn check_subgraph_exists(
Expand All @@ -21,7 +22,7 @@ fn create_subgraph(
// Create a fake manifest
let manifest = SubgraphManifest::<Chain> {
id: subgraph_id.clone(),
spec_version: String::from("0.0.2"),
spec_version: Version::new(0, 0, 2),
features: BTreeSet::new(),
description: None,
repository: None,
Expand Down
2 changes: 1 addition & 1 deletion chain/ethereum/src/runtime/runtime_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl blockchain::RuntimeAdapter<Chain> for RuntimeAdapter {
let eth_adapter = self
.eth_adapters
.cheapest_with(&NodeCapabilities {
archive: ds.mapping.requires_archive(),
archive: ds.mapping.requires_archive()?,
traces: false,
})?
.cheap_clone();
Expand Down
Loading