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
336 changes: 132 additions & 204 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ graphman-store = { path = "./core/graphman_store" }
graphql-tools = "0.5.0"
itertools = "0.14.0"
lazy_static = "1.5.0"
prost = "0.13"
prost-types = "0.13"
prost = "0.14"
prost-types = "0.14"
redis = { version = "1.0.2", features = [
"aio",
"connection-manager",
Expand All @@ -94,8 +94,9 @@ tokio = { version = "1.49.0", features = ["full"] }
tokio-stream = { version = "0.1.18", features = ["sync"] }
tokio-retry = "0.3.0"

tonic = { version = "0.12.3", features = ["tls-roots", "gzip"] }
tonic-build = { version = "0.12.3", features = ["prost"] }
tonic = { version = "0.14", features = ["tls-native-roots", "gzip"] }
tonic-prost = "0.14"
tonic-prost-build = "0.14"
tower-http = { version = "0.6.8", features = ["cors"] }
tower = { version = "0.5.1", features = ["full"] }
wasmparser = "0.118.1"
Expand All @@ -105,8 +106,8 @@ prometheus = "0.14.0"

# Dependencies related to Amp subgraphs
ahash = "0.8.11"
arrow = { version = "=55.0.0" }
arrow-flight = { version = "=55.0.0", features = ["flight-sql-experimental"] }
arrow = { version = "=57.0.0" }
arrow-flight = { version = "=57.0.0", features = ["flight-sql-experimental"] }
futures = "0.3.31"
half = "2.7.1"
indoc = "2.0.7"
Expand Down
2 changes: 1 addition & 1 deletion chain/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ graph-runtime-derive = { path = "../../runtime/derive" }
base64 = "0"

[build-dependencies]
tonic-build = { workspace = true }
tonic-prost-build = { workspace = true }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion chain/ethereum/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fn main() {
println!("cargo:rerun-if-changed=proto");

tonic_build::configure()
tonic_prost_build::configure()
.out_dir("src/protobuf")
.protoc_arg("--experimental_allow_proto3_optional")
.compile_protos(&["proto/ethereum.proto"], &["proto"])
Expand Down
218 changes: 113 additions & 105 deletions chain/ethereum/src/protobuf/sf.ethereum.r#type.v2.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion chain/near/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version.workspace = true
edition.workspace = true

[build-dependencies]
tonic-build = { workspace = true }
tonic-prost-build = { workspace = true }

[dependencies]
async-trait = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion chain/near/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fn main() {
println!("cargo:rerun-if-changed=proto");
tonic_build::configure()
tonic_prost_build::configure()
.out_dir("src/protobuf")
.extern_path(".sf.near.codec.v1", "crate::codec::pbcodec")
.compile_protos(&["proto/near.proto"], &["proto"])
Expand Down
3 changes: 2 additions & 1 deletion graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ url = "2.5.8"
prometheus = "0.14.0"
priority-queue = "2.7.0"
tonic = { workspace = true }
tonic-prost = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }

Expand Down Expand Up @@ -105,7 +106,7 @@ hex-literal = "1.1"
wiremock = "0.6.5"

[build-dependencies]
tonic-build = { workspace = true }
tonic-prost-build = { workspace = true }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion graph/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fn main() {
println!("cargo:rerun-if-changed=proto");
tonic_build::configure()
tonic_prost_build::configure()
.out_dir("src/firehose")
.compile_protos(
&[
Expand Down
5 changes: 3 additions & 2 deletions graph/src/amp/schema/generator/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ fn arrow_data_type_to_value_type(
Struct(_) => return type_not_supported(),
Union(_, _) => return type_not_supported(),
Dictionary(_, _) => return type_not_supported(),
Decimal128(_, _) => ValueType::BigDecimal,
Decimal256(_, _) => ValueType::BigDecimal,
Decimal32(_, _) | Decimal64(_, _) | Decimal128(_, _) | Decimal256(_, _) => {
ValueType::BigDecimal
}
Map(_, _) => return type_not_supported(),
RunEndEncoded(_, _) => return type_not_supported(),
};
Expand Down
16 changes: 13 additions & 3 deletions graph/src/firehose/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ const LOW_VALUE_THRESHOLD: usize = 10;
const LOW_VALUE_USED_PERCENTAGE: usize = 50;
const HIGH_VALUE_USED_PERCENTAGE: usize = 80;

pub trait BlockChainBlockMessage:
prost::Message + BlockchainBlock + Default + std::fmt::Debug + 'static
{
}

impl<T> BlockChainBlockMessage for T where
T: prost::Message + BlockchainBlock + Default + std::fmt::Debug + 'static
{
}

#[derive(Debug)]
pub struct FirehoseEndpoint {
pub provider: ProviderName,
Expand Down Expand Up @@ -411,7 +421,7 @@ impl FirehoseEndpoint {
logger: &Logger,
) -> Result<M, anyhow::Error>
where
M: prost::Message + BlockchainBlock + Default + 'static,
M: BlockChainBlockMessage,
{
let retry_log_message = format!("get_block_by_ptr for block {}", ptr);
let endpoint = self.cheap_clone();
Expand Down Expand Up @@ -473,7 +483,7 @@ impl FirehoseEndpoint {
logger: &Logger,
) -> Result<M, anyhow::Error>
where
M: prost::Message + BlockchainBlock + Default + 'static,
M: BlockChainBlockMessage,
{
let retry_log_message = format!("get_block_by_number for block {}", number);
let endpoint = self.cheap_clone();
Expand Down Expand Up @@ -511,7 +521,7 @@ impl FirehoseEndpoint {
logger: &Logger,
) -> Result<Vec<M>, anyhow::Error>
where
M: prost::Message + BlockchainBlock + Default + 'static,
M: BlockChainBlockMessage,
{
let logger = logger.clone();
let logger_for_error = logger.clone();
Expand Down
42 changes: 22 additions & 20 deletions graph/src/firehose/sf.ethereum.transform.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
/// CombinedFilter is a combination of "LogFilters" and "CallToFilters"
///
/// It transforms the requested stream in two ways:
/// 1. STRIPPING
/// The block data is stripped from all transactions that don't
/// match any of the filters.
///
/// 2. SKIPPING
/// If an "block index" covers a range containing a
/// block that does NOT match any of the filters, the block will be
/// skipped altogether, UNLESS send_all_block_headers is enabled
/// In that case, the block would still be sent, but without any
/// transactionTrace
/// 1. STRIPPING
/// The block data is stripped from all transactions that don't
/// match any of the filters.
///
/// 1. SKIPPING
/// If an "block index" covers a range containing a
/// block that does NOT match any of the filters, the block will be
/// skipped altogether, UNLESS send_all_block_headers is enabled
/// In that case, the block would still be sent, but without any
/// transactionTrace
///
/// The SKIPPING feature only applies to historical blocks, because
/// the "block index" is always produced after the merged-blocks files
/// are produced. Therefore, the "live" blocks are never filtered out.
///
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CombinedFilter {
#[prost(message, repeated, tag = "1")]
Expand All @@ -35,11 +35,12 @@ pub struct MultiLogFilter {
pub log_filters: ::prost::alloc::vec::Vec<LogFilter>,
}
/// LogFilter will match calls where *BOTH*
///
/// * the contract address that emits the log is one in the provided addresses -- OR addresses list is empty --
/// * the event signature (topic.0) is one of the provided event_signatures -- OR event_signatures is empty --
///
/// a LogFilter with both empty addresses and event_signatures lists is invalid and will fail.
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LogFilter {
#[prost(bytes = "vec", repeated, tag = "1")]
pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
Expand All @@ -54,11 +55,12 @@ pub struct MultiCallToFilter {
pub call_filters: ::prost::alloc::vec::Vec<CallToFilter>,
}
/// CallToFilter will match calls where *BOTH*
///
/// * the contract address (TO) is one in the provided addresses -- OR addresses list is empty --
/// * the method signature (in 4-bytes format) is one of the provided signatures -- OR signatures is empty --
///
/// a CallToFilter with both empty addresses and signatures lists is invalid and will fail.
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CallToFilter {
#[prost(bytes = "vec", repeated, tag = "1")]
pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
Expand All @@ -67,23 +69,23 @@ pub struct CallToFilter {
}
/// Deprecated: LightBlock is deprecated, replaced by HeaderOnly, note however that the new transform
/// does not have any transactions traces returned, so it's not a direct replacement.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LightBlock {}
/// HeaderOnly returns only the block's header and few top-level core information for the block. Useful
/// for cases where no transactions information is required at all.
///
/// The structure that would will have access to after:
///
/// ```ignore
/// ```text,ignore
/// Block {
/// int32 ver = 1;
/// bytes hash = 2;
/// uint64 number = 3;
/// uint64 size = 4;
/// BlockHeader header = 5;
/// int32 ver = 1;
/// bytes hash = 2;
/// uint64 number = 3;
/// uint64 size = 4;
/// BlockHeader header = 5;
/// }
/// ```
///
/// Everything else will be empty.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HeaderOnly {}
Loading
Loading