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

Krishna/sgc declared calls #2

Open
wants to merge 58 commits into
base: krishna/sgc-eth-host-fns
Choose a base branch
from

Conversation

incrypto32
Copy link
Owner

No description provided.

shuaibbapputty and others added 30 commits September 19, 2024 08:34
* graphman: define a store for execution data

* store: implement graphman store

* graphman: extract & refactor deployment info, pause, resume commands

* graphman: create graphql server to execute commands

* node: run graphman graphql server on startup

* graphman: use refactored commands in the cli

* graphman: document graphql api usage

* graphman: accept a list of deployments on restart command

* graphman: make docs clearer

* store: rename migration to make it latest
* ipfs: create new gateway and rpc clients

Introduces a new IPFS gateway client, refactoring the existing
RPC API client to reuse the new code. Also introduces some new
types and concepts to make working with IPFS easier.

* ipfs: use new ipfs types instead of old ones

Integrates the new IPFS types and clients into the existing codebase,
replacing the old types and client.
* Bump `async-graphql` from 7.0.6 to 7.0.11

This additionally bumps the `async-graphql-axum` crate, missed by
Dependabot.

Patches [`CVE-2024-47614`](https://nvd.nist.gov/vuln/detail/CVE-2024-47614):

async-graphql before 7.0.10 does not limit the number of directives for
a field. This can lead to Service Disruption, Resource Exhaustion, and
User Experience Degradation. This vulnerability is fixed in 7.0.10.

* Bump `diesel` from 2.2.1 to 2.2.4

Fixes [`RUSTSEC-2024-0365`](https://rustsec.org/advisories/RUSTSEC-2024-0365):

Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts

* Bump `object_store` from 0.10.1 to 0.11.0

Fixes [`RUSTSEC-2024-0358`](https://rustsec.org/advisories/RUSTSEC-2024-0358):

Apache Arrow Rust Object Store: AWS WebIdentityToken exposure in log
files

* Bump `openssl` from 0.10.64 to 0.10.66

Fixes [`RUSTSEC-2024-0357`](https://rustsec.org/advisories/RUSTSEC-2024-0357):

`MemBio::get_buf` has undefined behavior with empty buffers

* Bump `quinn-proto` from 0.11.3 to 0.11.8

Fixes [`RUSTSEC-2024-0373`](https://rustsec.org/advisories/RUSTSEC-2024-0373):

`Endpoint::retry()` calls can lead to panicking
Our queries all ultimately get their data by doing something like `select
to_jsonb(c.*) from ( ... complicated query ... ) c` because when these
queries were written it was far from obvious how to generate queries with
Diesel that select columns whose number and types aren't known at compile
time.

The call to `to_jsonb` forces Postgres to encode all data as JSON, which
graph-node then has to deserialize which is pretty wasteful both in terms
of memory and CPU.

This commit is focused on the groundwork for getting rid of these JSON
conversions and querying data in a more compact and native form with fewer
conversions. It only uses it in the fairly simple case of `Layout.find`,
but future changes will expand that use
When graph-node is restarted, we need to determine for subgraphs with
aggregations when the last rollup was triggered to ensure aggregations get
filled without gaps or duplication.

The code used the `block_time` column in the PoI table for that but that is
not correct as the PoI table only records blocks and times for which the
subgraph actually has writes. When the subgraph scans through a largish
number of blocks without changes, we only update the head pointer but also
do rollups as aggregation intervals pass. Because of that, we might perform
a rollup without a corresponding entry in the PoI table.

With this change, we actually find the maximum timestamp from all
aggregation tables to tell us when the last rollup was triggered as that
data reflects when rollups happened accurately.

For safety, this new behavior can be turned off by setting
`GRAPH_STORE_LAST_ROLLUP_FROM_POI=true` to return to the old buggy behavior
in case the new behavior causes some other unexpected problems.

Fixes graphprotocol#5530
)

In the integration tests, some subgraphs will sync on fraction3, leading
to an error as they failed to sync on integer.

On some runs, fraction3 will also error leading to a successful test;
this happens when the subgraph fails to sync due to an HTTP 521 error
received when querying the testnet IPFS node. This is a
non-deterministic error, and the request can simply be retried.
)

- Remove `tsvector` columns from `SELECT` clauses in entity queries
- Filter out full-text search columns from the list of selected columns

Full-text search columns (`tsvector` type) are used for indexing and
efficient text searching, but they are not part of the entity's data
model and are not meant to be directly queried or returned. This fixes a
bug where trying to load a tsvector column fails, as diesel does not
natively have tsvector support, and we don't explicitly handle the type
in `relational::value::OidValue::from_sql`.
* ipfs: optimize retries

* ipfs: add more tests
* graph: refactor provider manager to support extended block checks

* firehose: use endpoint info

* node: add optional extended block checks for providers

* node: enable extended blocks checks for all chains by default

* graph: add provider check strategy to make api nicer

* graph: add tests for provider checks

* graph: prepare graphman cli integration & clean-up tests

* node: update graphman provider checks command

* graphman: enable extended blocks check on deployment run
* graph: Stop subgraphs passing max endBlock

* update end_block runner test

* Update comment

Co-authored-by: Krishnanand V P <[email protected]>

---------

Co-authored-by: Krishnanand V P <[email protected]>
encalypto and others added 7 commits November 20, 2024 11:17
In graphprotocol#5620, we updated our base Debian image tag, resulting in our
installation of the `netcat` package failing due to being made a
virtual package (provided by either `netcat-openbsd` and
`netcat-traditional`). Here, we opt to specifically use `netcat-openbsd`
to match Bullseye's default.
updated all images to bookworm
fixed dockerfile syntax deprecations
This adds a `graph-indexed` header to query responses. The header value contains the block hash, number, and timestamp for the most recently processed block in the subgraph. This avoids the need to rewrite all queries to include `_meta { block { hash number timestamp } }` in either the indexer-service or gateway.

Related: edgeandnode/gateway#900, graphprotocol/indexer-rs#494
@incrypto32 incrypto32 force-pushed the krishna/sgc-eth-host-fns branch from 9988257 to 1dd59c3 Compare December 3, 2024 07:48
zorancv and others added 21 commits December 4, 2024 15:10
Roundtripping arrays of enums would fail because we would read an array of
enums back as a single string "{yellow,red,BLUE}" instead of the array
["yellow", "red", "BLUE"]. Storing an update to such an entity, even if
users make no changes to that field, would fail because Postgres expects an
array and we were sending a scalar value.

This fixes a bug introduced in PR
graphprotocol#5372
* graph, core: add deployment_status metric

* update news with the implemented changes
@incrypto32 incrypto32 force-pushed the krishna/sgc-declared-calls branch from 05cc740 to 11de62e Compare January 31, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.