Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
283 commits
Select commit Hold shift + click to select a range
2f35531
all: Asyncify SubgraphStore.graft_pending
lutter Oct 7, 2025
d3a96ae
all: Asyncify SubgraphStore.input_schema
lutter Oct 7, 2025
844d1d0
all: Asyncify SubgraphStore.entity_changes_in_block
lutter Oct 7, 2025
ff511b6
all: Asyncify SubgraphStore.subgraph_exists
lutter Oct 7, 2025
8c71f9c
all: Remove unused SubgraphStore.assignments
lutter Oct 7, 2025
74f0b01
all: Asyncify SubgraphStore.assigned_node
lutter Oct 7, 2025
4b42e3c
all: Asyncify SubgraphStore.resume_subgraph
lutter Oct 7, 2025
c22f301
all: Asyncify SubgraphStore.pause_subgraph
lutter Oct 7, 2025
3b51123
all: Asyncify SubgraphStore.unassign_subgraph
lutter Oct 7, 2025
2687e49
all: Asyncify test util tap_store_events
lutter Oct 7, 2025
e76b09a
all: Asyncify SubgraphStore.reassign_subgraph
lutter Oct 7, 2025
3c51053
all: Asyncify SubgraphStore.remove_subgraph
lutter Oct 7, 2025
184f68c
all: Asyncify SubgraphStore.create_subgraph
lutter Oct 7, 2025
c071661
all: Asyncify SubgraphStore.create_subgraph_features
lutter Oct 7, 2025
037c8ed
all: Asyncify SubgraphStore.create_subgraph_deployment
lutter Oct 7, 2025
f939f10
all: Asyncify SubgraphStore.is_deployed
lutter Oct 7, 2025
26dad83
all: Asyncify EnsLookup
lutter Oct 7, 2025
a443ea2
all: Asyncify SubgraphFork
lutter Oct 7, 2025
9a746cb
node, store, tests: Asyncify BlockStore.new and BlockStore.lookup_chain
lutter Oct 7, 2025
f7cc7f3
all: Asyncify Mirror.assignments
lutter Oct 7, 2025
d80b7e1
all: Asyncify Mirror.assigned_node
lutter Oct 7, 2025
022d17a
store: Add async variants of connection getters
lutter Oct 8, 2025
4d5d2cc
store: Make ConnectionPool.try_get_fdw private
lutter Oct 8, 2025
ec7e2c5
store: Make ConnectionPool.get_fdw private
lutter Oct 8, 2025
b04f963
store: Use ConnectionPool.get_async in some easy places
lutter Oct 8, 2025
af1a9ca
node: Use ConnectionPool.get_async() instead of get()
lutter Oct 8, 2025
cdb1fd6
node, core, server: Use ConnectionPool.get_async() in graphman server…
lutter Oct 8, 2025
4e3baff
all: Make async-trait a workspace package
lutter Oct 8, 2025
24f25f0
all: Asyncify GraphmanStore
lutter Oct 8, 2025
826c83a
all: Asyncify prune::status::Viewer
lutter Oct 8, 2025
9e99455
store: Use ConnectionPool.get_async() in EnsLookup
lutter Oct 8, 2025
3f89689
store: Make Mirror.read_async take an AsyncFn
lutter Oct 8, 2025
3db8e8f
graph, node, store: Make BlockStore implement CheapClone
lutter Oct 8, 2025
ab32846
store: Use ConnectionPool.get_async() in ChainStore.get_conn
lutter Oct 8, 2025
adc3fa7
store: Remove duplicate unused BlockStore.set_chain_identifier
lutter Oct 8, 2025
499e9e5
store: Use ConnectionPool.get_async() in remaining places in BlockSto…
lutter Oct 8, 2025
6cc4311
store: Use ConnectionPool.get_async() in run_test_with_conn
lutter Oct 8, 2025
99ca2d9
runtime, store: Use ConnectionPool.get_async() in remaining tests
lutter Oct 8, 2025
2558fd1
store: Add a helper ConnectionPool.with_conn_async
lutter Oct 8, 2025
10a2cf0
store: Use with_conn_async instead of with_conn
lutter Oct 8, 2025
ff0d795
store: Remove the now unused with_conn functions
lutter Oct 8, 2025
9329945
store: Rename with_conn_async to with_conn
lutter Oct 8, 2025
d5d1bfc
store: Mark create_subgraph_deployment_internal async
lutter Oct 8, 2025
63fbc7b
node, store: Mark a bunch of functions as async
lutter Oct 8, 2025
34905f0
store: Add a shim to use async functions in transactions
lutter Oct 9, 2025
d12990f
store: Use transaction_async for all of ChainStore
lutter Oct 9, 2025
adb0781
node, store: Use transaction_async in change_block_cache_shard command
lutter Oct 9, 2025
d806aa1
store: Asyncify deployment::with_lock
lutter Oct 9, 2025
dbcdebb
store: Asyncify prune::TablePair.switch
lutter Oct 9, 2025
f5f6115
store: Asyncify batch_with_timeout
lutter Oct 9, 2025
3d78441
store: Asyncify prune::status::Tracker.start
lutter Oct 9, 2025
8beca35
store: Use transaction_async everywhere in mod pool
lutter Oct 9, 2025
a25b3de
store: Remove pointless transaction from recreate_invalid_indexes
lutter Oct 9, 2025
22def93
store: Remove some transactions from DeploymentStore
lutter Oct 9, 2025
466a794
store: Use transaction_async in DeploymentStore
lutter Oct 9, 2025
715473d
store: Use transaction_async in mod copy
lutter Oct 9, 2025
08c8da6
store: Use transaction_async in Layout.query
lutter Oct 9, 2025
7d893e0
store: Simplify primary::Connection
lutter Oct 10, 2025
7570b72
store: Use retry::forever_async in SyncStore.start_subgraph_deployment
lutter Oct 10, 2025
44cbcb2
store: Use retry::forever_async in SyncStore.get
lutter Oct 10, 2025
914f534
store: Use retry::forever_async in SyncStore.get_many
lutter Oct 10, 2025
3a5f863
store: Use retry::forever_async in SyncStore.get_derived
lutter Oct 10, 2025
7c02550
store: Use retry::forever_async in SyncStore.unassign_subgraph and pa…
lutter Oct 10, 2025
7ca2dc0
store: Introduce a primary::Connection::transaction_async
lutter Oct 10, 2025
da483f1
store: Use primary::Connection::transaction_async in drop_site
lutter Oct 10, 2025
fedbc65
store: Rename primary::Connection::transaction_async to transaction
lutter Oct 10, 2025
13d9ad3
store: Asyncify primary::Primary and primary::is_empty
lutter Oct 10, 2025
794fe6f
store: Asyncify some methods in primary::Mirror
lutter Oct 10, 2025
900dde9
store: Modify the logic around calling exists_and_synced in create_su…
lutter Oct 10, 2025
9833cb3
store: Small refactoring of SubgraphSTore
lutter Oct 10, 2025
7a83523
store: Move create_deployment_internal to SubgraphStore
lutter Oct 10, 2025
4b154d7
store: Make create_subgraph_version async
lutter Oct 10, 2025
2f50bcb
store: Asyncify all SubgraphStore methods that are only used by tests
lutter Oct 10, 2025
706efb6
store: Asyncify SubgraphStore.store
lutter Oct 10, 2025
c823624
store: Asyncify primary::Mirror.find_active_site
lutter Oct 10, 2025
fe1cdab
store: Asyncify primary::Connection.allocate_site
lutter Oct 10, 2025
9737e46
store: Asyncify primary::Mirror.find_site_by_ref
lutter Oct 10, 2025
b6e6c3a
store: Reduce the need for Mirror.read_async to take ownership/clones
lutter Oct 10, 2025
c20e56d
store: Use Mirror.read_async in most places where read was used
lutter Oct 10, 2025
b565128
all: Use read_async in primary::Mirror.fill_assignments
lutter Oct 10, 2025
eba990a
store: Asyncify primary::Connection.send_store_event
lutter Oct 10, 2025
5cb4ffa
store: Asyncify primary::Connection.cancel_copies
lutter Oct 11, 2025
d075421
store: Asyncify primary::Connection.create_subgraph
lutter Oct 11, 2025
8d69439
store: Asyncify primary::Connection.pause_subgraph
lutter Oct 11, 2025
89fb41b
store: Asyncify primary::Connection.resume_subgraph
lutter Oct 11, 2025
82bd167
store: Asyncify primary::Connection.reassign_subgraph
lutter Oct 11, 2025
85fe7db
store: Asyncify primary::Connection.get_subgraph_features
lutter Oct 11, 2025
df8d0c7
store: Asyncify primary::Connection.create_subgraph_features
lutter Oct 11, 2025
43b417c
store: Asyncify primary::Connection.assign_subgraph
lutter Oct 11, 2025
67f9511
store: Asyncify primary::Connection.create_site
lutter Oct 11, 2025
7bf6c1f
store: Asyncify primary::Connection.assigned_node
lutter Oct 11, 2025
b40294e
store: Asyncify primary::Connection.assignment_status
lutter Oct 11, 2025
483ac58
store: Asyncify primary::Connection.activate
lutter Oct 11, 2025
220fab2
store: Asyncify primary::Connection.locate_site
lutter Oct 11, 2025
0226012
store: Asyncify primary::Connection.find_sites_for_network
lutter Oct 11, 2025
7325b38
store: Asyncify primary::Connection.sites
lutter Oct 11, 2025
ac101a1
store: Asyncify primary::Connection.least_assigned_node
lutter Oct 11, 2025
934e86a
store: Asyncify primary::Connection.least_used_shard
lutter Oct 11, 2025
20fd1b0
store: Asyncify primary::Connection.versions_for_subgraph
lutter Oct 11, 2025
edf88ba
store: Asyncify primary::Connection.deployment_for_version
lutter Oct 11, 2025
f4dbcb8
store: Asyncify unused deployment methods in primary::Connection
lutter Oct 11, 2025
81a0e59
store: Asyncify primary::Connection.subgraphs_using_deployment
lutter Oct 11, 2025
d77cf34
store: Asyncify ENS methods in primary::Connection
lutter Oct 11, 2025
ceddf91
store: Asyncify copy status methods in primary::Connection
lutter Oct 11, 2025
8ca3539
store: Asyncify primary::Connection::queries
lutter Oct 11, 2025
5237f83
store: Asyncify deployment::graft
lutter Oct 11, 2025
2f1eb2d
store: Asyncify deployment::debug_fork
lutter Oct 11, 2025
0cca387
store: Asyncify deployment::schema
lutter Oct 11, 2025
19a6fd9
store: Rename retry::forever_async to retry::forever
lutter Oct 11, 2025
65c36b1
store: Asyncify deployment::ManifestInfo.load
lutter Oct 11, 2025
426880c
store: Asyncify deployment::history_blocks
lutter Oct 11, 2025
0b0eb52
store: Asyncify deployment::set_history_blocks
lutter Oct 11, 2025
5fc2158
store: Asyncify deployment::set_manifest_raw_yaml
lutter Oct 11, 2025
9d484e0
store: Asyncify deployment::reset_reorg_count
lutter Oct 11, 2025
7cf0215
store: Asyncify deployment::get_subgraph_firehose_cursor
lutter Oct 11, 2025
ae215fb
store: Asyncify deployment::revert_block_ptr
lutter Oct 11, 2025
fc2fb78
store: Asyncify deployment::block_ptr
lutter Oct 11, 2025
678905a
store: Asyncify deployment::initialize_block_ptr
lutter Oct 11, 2025
493e1d3
store: Asyncify deployment::state
lutter Oct 11, 2025
33f8070
store: Asyncify deployment::set_synced
lutter Oct 11, 2025
a558a89
store: Asyncify deployment::exists
lutter Oct 11, 2025
ec3a632
store: Asyncify deployment::exists_and_synced
lutter Oct 11, 2025
3db612b
store: Asyncify deployment::insert_subgraph_errors
lutter Oct 11, 2025
115e71a
store: Asyncify deployment::error_count
lutter Oct 11, 2025
9d7a6e6
store: Asyncify deployment::revert_subgraph_errors
lutter Oct 11, 2025
2c46cab
store: Asyncify deployment::delete_error
lutter Oct 11, 2025
b60a600
store: Asyncify deployment::copy_errors
lutter Oct 11, 2025
466658f
store: Asyncify deployment::drop_schema and drop_metadata
lutter Oct 11, 2025
234e95d
store: Asyncify deployment::create_deployment
lutter Oct 11, 2025
cc75014
store: Asyncify deployment::update_entity_count
lutter Oct 11, 2025
8cfee64
store: Asyncify deployment::clear_entity_count
lutter Oct 11, 2025
d6adcb4
store: Asyncify deployment::set_earliest_block
lutter Oct 11, 2025
784cda4
store: Asyncify deployment::copy_earliest_block
lutter Oct 11, 2025
0f7967a
store: Asyncify deployment::on_sync
lutter Oct 11, 2025
485f6bc
store: Asyncify deployment::set_on_sync
lutter Oct 11, 2025
7feface
store: Asyncify dynds::private::DataSourcesTable.load
lutter Oct 11, 2025
a825f93
store: Asyncify dynds::private::DataSourcesTable.insert
lutter Oct 11, 2025
4f05f07
store: Asyncify dynds::private::DataSourcesTable.revert
lutter Oct 11, 2025
83845f0
store: Asyncify dynds::private::DataSourcesTable.update_offchain_status
lutter Oct 11, 2025
bdfd637
store: Asyncify dynds::shared
lutter Oct 11, 2025
7261a23
store: Asyncify dynds::causality_region_curr_val
lutter Oct 11, 2025
b81302f
store: Asyncify relational::load_indexes_from_table
lutter Oct 11, 2025
578d8f7
store: Asyncify Layout.analyze_tables
lutter Oct 11, 2025
497dc2f
store: Asyncify relational::prune::status::Tracker
lutter Oct 11, 2025
fab74a5
store: Asyncify rollup::Rollup::insert
lutter Oct 11, 2025
55f855a
store: Asyncify rollup::Rollup::last_rollup
lutter Oct 11, 2025
3815be7
store: Asyncify advisory_lock::Scope::try_lock
lutter Oct 11, 2025
8d80077
store: Asyncify advisory_lock::lock
lutter Oct 11, 2025
5a09c1f
store: Asyncify advisory_lock::unlock
lutter Oct 11, 2025
25ea756
store: Asyncify advisory_lock::with_migration_lock.execute
lutter Oct 12, 2025
0533711
store: Asyncify remaining methods in block_store
lutter Oct 12, 2025
893f087
store: Asyncify Layout::create_relational_schema
lutter Oct 12, 2025
2f4c03f
store: Refactor CopyState::create
lutter Oct 12, 2025
4da35ab
store: Refactor TableState.load
lutter Oct 12, 2025
81b6497
store: Asyncify catalog::histogram_bounds
lutter Oct 12, 2025
873e096
Asyncify remaining method in catalog
lutter Oct 12, 2025
9c4e37c
store: Asyncify chain_store::Storage
lutter Oct 12, 2025
3a1e32b
store: Asyncify remaining methods in copy
lutter Oct 12, 2025
11bc7c7
store: Asyncify most methods in deployment_store
lutter Oct 12, 2025
d95740d
store: Asyncify DeploymentStore::get_conn
lutter Oct 12, 2025
a6cd56b
store: Asyncify remaining methods in deployment
lutter Oct 12, 2025
13fe653
store: Asyncify details
lutter Oct 12, 2025
a2d4f39
store: Asyncify notification_listener
lutter Oct 12, 2025
8d3fa2c
store: Asyncify Layout.find
lutter Oct 12, 2025
6362fcf
store: Asyncify VidBatcher.for_copy and for_prune
lutter Oct 12, 2025
d21f2f7
store: Replace remaining uses of ConnectionPool.get with get_async
lutter Oct 12, 2025
e0c4b10
all: Rename ConectionPool.get_async to get_sync
lutter Oct 12, 2025
1a75d70
core: Asyncify core::graphman::deployment::load_deployments
lutter Oct 13, 2025
fbd32d9
store: Use an async connection pool (SQUASH FROM HERE)
lutter Oct 7, 2025
4daa82d
core: Use async connection in graphman::src::deployment
lutter Oct 13, 2025
d27c25f
store: Replace use of SimpleConnection with async version in deployme…
lutter Oct 13, 2025
d66df18
store: Use AsyncPgConnection in DeploymentStore and related methods
lutter Oct 16, 2025
49be73e
store: Use AsyncPgConnection in primary::Mirror::refresh_tables
lutter Oct 16, 2025
bcd3d86
store: Use AsyncPgConnection in DeploymentStore.indexes_for_entity
lutter Oct 16, 2025
f46cbef
store: Use AsyncPgConnection in DeploymentStore.drop_index
lutter Oct 16, 2025
02d1a18
store: Use AsyncPgConnection in DeploymentStore.load_indexes
lutter Oct 16, 2025
8cefc37
store: Use AsyncPgConnection in DeploymentStore.set_account_like
lutter Oct 16, 2025
f7257b4
store: Use AsyncPgConnection in DeploymentStore.set_history_blocks
lutter Oct 16, 2025
6dc32c1
store: Use AsyncPgConnection in more places
lutter Oct 17, 2025
3f477a0
store: Remove use of with_conn from DeploymentStore.block_ptr, block_…
lutter Oct 17, 2025
5ec233f
store: Remove use of with_conn from DeploymentStore.deployment_state
lutter Oct 17, 2025
9d55643
store: Remove use of with_conn from DeploymentStore.fail_subgraph
lutter Oct 17, 2025
dcc9d4b
store: Remove use of with_conn from DeploymentStore.load_dynamic_data…
lutter Oct 17, 2025
76f3568
store: Remove use of with_conn from DeploymentStore.causality_region_…
lutter Oct 17, 2025
125c7dd
store: Remove use of with_conn from DeploymentStore.exists_and_synced…
lutter Oct 17, 2025
7580534
store: Remove use of with_conn from DeploymentStore.refresh_materiali…
lutter Oct 17, 2025
cea1126
store: Remove use of with_conn from DeploymentStore.prune_viewer
lutter Oct 17, 2025
bf89043
store: Remove use of with_conn from ChainStore.blocks_from_store
lutter Oct 17, 2025
f234b71
store: Remove use of with_conn from ChainStore.blocks_from_store_by_n…
lutter Oct 17, 2025
276742c
store: Remove use of with_conn from ChainHeadStore.chain_head_ptr
lutter Oct 17, 2025
c4a3cd9
store: Remove use of with_conn from ChainHeadStore.set_chain_head
lutter Oct 17, 2025
cc04e10
store: Remove use of with_conn from ChainHeadStore.ancestor_block
lutter Oct 17, 2025
63c00ed
store: Remove use of with_conn from ChainHeadStore.block_number
lutter Oct 17, 2025
66210d1
store: Remove use of with_conn from ChainHeadStore.block_numbers
lutter Oct 17, 2025
80aaa54
store: Remove use of with_conn from ChainHeadStore.transaction_receip…
lutter Oct 17, 2025
9d821b6
store: Remove use of with_conn from ChainStore.set_call
lutter Oct 17, 2025
0852e6d
store: Remove use of with_conn from NotificationQueueUsage.update
lutter Oct 17, 2025
cf2615d
store: Refactor ChainStore.attempt_chain_head_update
lutter Oct 17, 2025
84af4a3
store: Remove use of with_conn from ChainStore.attempt_chain_head_update
lutter Oct 17, 2025
3e1cc42
store: Use AsyncPgConnection in PoolCoordinator.setup
lutter Oct 17, 2025
c1f2ce7
store: Use AsyncPgConnection in PoolInner.check
lutter Oct 17, 2025
02b866f
store: Use AsyncPgConnection in PoolInner.remap and create/drop_cross…
lutter Oct 17, 2025
994646a
store: Use AsyncPgConnection in PoolInner.remap
lutter Oct 17, 2025
6f94778
store: Use AsyncPgConnection in PoolInner.needs_remap
lutter Oct 17, 2025
5569c88
store: Use AsyncConnectionWrapper explicitly to run migrations
lutter Oct 17, 2025
61fe817
store: Remove PoolInner.get_sync
lutter Oct 17, 2025
466d6c8
store: Use diesel_async::RunQueryDsl in primary
lutter Oct 17, 2025
477ae12
store: Use diesel_async::RunQueryDsl in primary::queries
lutter Oct 17, 2025
32291ab
store: Use AsyncPgConnection in primary::Connection
lutter Oct 17, 2025
0741471
store: Use doesel_async::RunQueryDsl in block_store
lutter Oct 17, 2025
40fd6ac
store: Use AsyncPgConnection in remaining plces in primary
lutter Oct 17, 2025
0ee9bb1
store: Use AsyncPgConnection in DeploymentStore.create_deployment
lutter Oct 17, 2025
8a07155
store: Use AsyncPgConnection in DeploymentStore.get_replica_conn
lutter Oct 17, 2025
991257e
store: Use AsyncPgConnection in DeploymentStore.find_layout
lutter Oct 17, 2025
73d15a5
store: Use AsyncPgConnection in DeploymentStore.subgraph_info
lutter Oct 17, 2025
9b0ff5e
store: Use AsyncPgConnection in a few more DeploymentStore methods
lutter Oct 17, 2025
b2fdf75
store: Use doesel_async::RunQueryDsl in copy
lutter Oct 17, 2025
6389e18
store: Use AsyncPgConnection in DeploymentStore.source_of_copy
lutter Oct 18, 2025
8622927
store: Use AsyncPgConnection in remaining places in relational
lutter Oct 18, 2025
74ed64f
store: Use AsyncPgConnection in remaining places in dynds
lutter Oct 18, 2025
787f9ef
store: Use AsyncPgConnection in remaining places in chain_store
lutter Oct 18, 2025
09302ba
store: Use AsyncPgConnection in remaining places in copy
lutter Oct 18, 2025
d415c87
store: Use diesel_async::RunQueryDsl in relational/index
lutter Oct 18, 2025
14e4764
test-store: Use diesel_async::RunQueryDsl in chain_head tests
lutter Oct 18, 2025
ebde747
store: Use AsyncPgConnection in remaining places
lutter Oct 18, 2025
229be36
node: Use AsyncPgConnection in remaining places
lutter Oct 18, 2025
42d8b08
test-store: Use AsyncPgConnection in remaining places
lutter Oct 18, 2025
868f82d
store: Get AsyncPgConnection from pool in DeploymentStore
lutter Oct 18, 2025
a2b2f0f
store: Get AsyncPgConnection from pool in chain_store
lutter Oct 18, 2025
1597a73
store: Replace uses of Pool.get_sync with Pool.get
lutter Oct 18, 2025
55faaee
node: Replace uses of Pool.get_sync with Pool.get
lutter Oct 18, 2025
b4e6a5b
server, store: Replace remaining uses of Pool.get_sync with Pool.get
lutter Oct 18, 2025
c24580f
store: Use AsyncPgConnection for fdw pool
lutter Oct 18, 2025
13bfeda
store: Use AsyncPgConnection for PoolInner.locale_check
lutter Oct 18, 2025
825a8ad
store: Remove support for synchronous connections
lutter Oct 18, 2025
c0506fe
store: Make sure migrations run completely on a blocking thread (CI P…
lutter Oct 19, 2025
c399440
store: Make the worker futures in copy Send
lutter Oct 21, 2025
b1ea931
store: Do not use block_on in WritableStore.start_subgraph_deployment
lutter Oct 21, 2025
939391c
all: Use a workspace package for tokio
lutter Oct 22, 2025
b8ba587
all: Rename graph::task_spawn to tokio and move TEST_RUNTIME there
lutter Oct 22, 2025
fdc19ff
all: Add a `graph::test` macro
lutter Oct 22, 2025
f54467a
all: Use #[graph::test] instead of #[tokio::test]
lutter Oct 22, 2025
9f0ce51
store: Make test_clear_stale_call_cache in sharded setup
lutter Oct 22, 2025
c7a49a9
store: Switch from mobc to deadpool
lutter Oct 20, 2025
6030b45
store: Create the state_racker in PoolInner::create
lutter Oct 23, 2025
f188afe
store: Replicate the metrics that EventHandler used to collect with d…
lutter Oct 23, 2025
9b227c4
store: Rename the pool/state_tracker module to manager
lutter Oct 23, 2025
d195ee3
store: Implement our own deadpool Manager
lutter Oct 23, 2025
a7a9f3a
store: Move ErrorHandler functionality to ConnectionManager
lutter Oct 23, 2025
6e768dc
store: Reap idle connections according to configuration
lutter Oct 23, 2025
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
141 changes: 118 additions & 23 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ license = "MIT OR Apache-2.0"
anyhow = "1.0"
async-graphql = { version = "7.0.17", features = ["chrono"] }
async-graphql-axum = "7.0.17"
async-trait = "0.1.74"
axum = "0.8.4"
chrono = "0.4.42"
bs58 = "0.5.1"
Expand All @@ -55,6 +56,7 @@ diesel = { version = "2.2.7", features = [
"chrono",
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
] }
diesel-async = { version = "0.7.3", features = ["deadpool", "async-connection-wrapper", "tokio", "postgres"] }
diesel-derive-enum = { version = "2.1.0", features = ["postgres"] }
diesel-dynamic-schema = { version = "0.2.3", features = ["postgres"] }
diesel_derives = "2.2.7"
Expand Down Expand Up @@ -90,7 +92,11 @@ strum = { version = "0.26", features = ["derive"] }
syn = { version = "2.0.106", features = ["full"] }
test-store = { path = "./store/test-store" }
thiserror = "2.0.16"
deadpool = { version = "0.12", features = ["rt_tokio_1", "managed"] }
tokio = { version = "1.45.1", features = ["full"] }
tokio-stream = { version = "0.1.15", features = ["sync"] }
tokio-retry = "0.3.0"

tonic = { version = "0.12.3", features = ["tls-roots", "gzip"] }
tonic-build = { version = "0.12.3", features = ["prost"] }
tower-http = { version = "0.6.6", features = ["cors"] }
Expand Down
3 changes: 3 additions & 0 deletions chain/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version.workspace = true
edition.workspace = true

[dependencies]
async-trait = { workspace = true }
envconfig = "0.11.0"
jsonrpc-core = "18.0.0"
graph = { path = "../../graph" }
Expand All @@ -15,6 +16,8 @@ tiny-keccak = "1.5.0"
hex = "0.4.3"
semver = "1.0.27"
thiserror = { workspace = true }
tokio = { workspace = true }
tokio-stream = { workspace = true }

itertools = "0.14.0"

Expand Down
1 change: 1 addition & 0 deletions chain/ethereum/src/adapter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use anyhow::Error;
use async_trait::async_trait;
use ethabi::{Error as ABIError, ParamType, Token};
use graph::blockchain::ChainIdentifier;
use graph::components::subgraph::MappingError;
Expand Down
31 changes: 16 additions & 15 deletions chain/ethereum/src/buffered_call_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{
sync::{Arc, Mutex},
};

use async_trait::async_trait;
use graph::{
cheap_clone::CheapClone,
components::store::EthereumCallCache,
Expand Down Expand Up @@ -47,8 +48,9 @@ impl BufferedCallCache {
}
}

#[async_trait]
impl EthereumCallCache for BufferedCallCache {
fn get_call(
async fn get_call(
&self,
call: &call::Request,
block: BlockPtr,
Expand All @@ -59,7 +61,7 @@ impl EthereumCallCache for BufferedCallCache {
return Ok(Some(value));
}

let result = self.call_cache.get_call(&call, block)?;
let result = self.call_cache.get_call(&call, block).await?;

let mut buffer = self.buffer.lock().unwrap();
if let Some(call::Response {
Expand All @@ -73,7 +75,7 @@ impl EthereumCallCache for BufferedCallCache {
Ok(result)
}

fn get_calls(
async fn get_calls(
&self,
reqs: &[call::Request],
block: BlockPtr,
Expand All @@ -90,7 +92,7 @@ impl EthereumCallCache for BufferedCallCache {
}
}

let (stored, calls) = self.call_cache.get_calls(&missing, block)?;
let (stored, calls) = self.call_cache.get_calls(&missing, block).await?;

{
let mut buffer = self.buffer.lock().unwrap();
Expand All @@ -103,15 +105,15 @@ impl EthereumCallCache for BufferedCallCache {
Ok((resps, calls))
}

fn get_calls_in_block(
async fn get_calls_in_block(
&self,
block: BlockPtr,
) -> Result<Vec<CachedEthereumCall>, graph::prelude::Error> {
self.call_cache.get_calls_in_block(block)
self.call_cache.get_calls_in_block(block).await
}

fn set_call(
&self,
async fn set_call(
self: Arc<Self>,
logger: &Logger,
call: call::Request,
block: BlockPtr,
Expand All @@ -130,15 +132,14 @@ impl EthereumCallCache for BufferedCallCache {

let cache = self.call_cache.cheap_clone();
let logger = logger.cheap_clone();
let _ = graph::spawn_blocking_allow_panic(move || {
cache
.set_call(&logger, call.cheap_clone(), block, return_value)
.map_err(|e| {
error!(logger, "BufferedCallCache: call cache set error";
if let Err(e) = cache
.set_call(&logger, call.cheap_clone(), block, return_value)
.await
{
error!(logger, "BufferedCallCache: call cache set error";
"contract_address" => format!("{:?}", call.address),
"error" => e.to_string())
})
});
}

Ok(())
}
Expand Down
23 changes: 13 additions & 10 deletions chain/ethereum/src/chain.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::{anyhow, bail, Result};
use anyhow::{Context, Error};
use async_trait::async_trait;
use graph::blockchain::client::ChainClient;
use graph::blockchain::firehose_block_ingestor::{FirehoseBlockIngestor, Transforms};
use graph::blockchain::{
Expand Down Expand Up @@ -32,8 +33,8 @@ use graph::{
components::store::DeploymentLocator,
firehose,
prelude::{
async_trait, o, serde_json as json, BlockNumber, ChainStore, EthereumBlockWithCalls,
Logger, LoggerFactory,
o, serde_json as json, BlockNumber, ChainStore, EthereumBlockWithCalls, Logger,
LoggerFactory,
},
};
use prost::Message;
Expand Down Expand Up @@ -551,9 +552,11 @@ impl Blockchain for Chain {
self.block_refetcher.get_block(self, logger, cursor).await
}

fn runtime(&self) -> anyhow::Result<(Arc<dyn RuntimeAdapterTrait<Self>>, Self::DecoderHook)> {
async fn runtime(
&self,
) -> anyhow::Result<(Arc<dyn RuntimeAdapterTrait<Self>>, Self::DecoderHook)> {
let call_cache = Arc::new(BufferedCallCache::new(self.call_cache.cheap_clone()));
let chain_ident = self.chain_store.chain_identifier()?;
let chain_ident = self.chain_store.chain_identifier().await?;

let builder = self.runtime_adapter_builder.build(
self.eth_adapters.cheap_clone(),
Expand Down Expand Up @@ -1266,7 +1269,7 @@ impl FirehoseMapperTrait<Chain> for FirehoseMapper {
#[cfg(test)]
mod tests {
use graph::blockchain::mock::MockChainStore;
use graph::{slog, tokio};
use graph::slog;

use super::*;
use std::sync::Arc;
Expand All @@ -1283,7 +1286,7 @@ mod tests {
}
}

#[tokio::test]
#[graph::test]
async fn test_fetch_unique_blocks_single_block() {
let logger = Logger::root(slog::Discard, o!());
let mut chain_store = MockChainStore::default();
Expand All @@ -1302,7 +1305,7 @@ mod tests {
assert!(missing.is_empty());
}

#[tokio::test]
#[graph::test]
async fn test_fetch_unique_blocks_duplicate_blocks() {
let logger = Logger::root(slog::Discard, o!());
let mut chain_store = MockChainStore::default();
Expand All @@ -1325,7 +1328,7 @@ mod tests {
assert_eq!(missing[0], 1);
}

#[tokio::test]
#[graph::test]
async fn test_fetch_unique_blocks_missing_blocks() {
let logger = Logger::root(slog::Discard, o!());
let mut chain_store = MockChainStore::default();
Expand All @@ -1344,7 +1347,7 @@ mod tests {
assert_eq!(missing, vec![2]);
}

#[tokio::test]
#[graph::test]
async fn test_fetch_unique_blocks_multiple_valid_blocks() {
let logger = Logger::root(slog::Discard, o!());
let mut chain_store = MockChainStore::default();
Expand All @@ -1366,7 +1369,7 @@ mod tests {
assert!(missing.is_empty());
}

#[tokio::test]
#[graph::test]
async fn test_fetch_unique_blocks_mixed_scenario() {
let logger = Logger::root(slog::Discard, o!());
let mut chain_store = MockChainStore::default();
Expand Down
2 changes: 1 addition & 1 deletion chain/ethereum/src/data_source.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::{anyhow, Error};
use anyhow::{ensure, Context};
use async_trait::async_trait;
use graph::blockchain::{BlockPtr, TriggerWithHandler};
use graph::components::link_resolver::LinkResolverContext;
use graph::components::metrics::subgraph::SubgraphInstanceMetrics;
Expand Down Expand Up @@ -33,7 +34,6 @@ use tiny_keccak::{keccak256, Keccak};
use graph::{
blockchain::{self, Blockchain},
prelude::{
async_trait,
ethabi::{Address, Event, Function, LogParam, ParamType, RawLog},
serde_json, warn,
web3::types::{Log, Transaction, H256},
Expand Down
19 changes: 10 additions & 9 deletions chain/ethereum/src/ethereum_adapter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use async_trait::async_trait;
use futures03::{future::BoxFuture, stream::FuturesUnordered};
use tokio::sync::RwLock;
use tokio::time::timeout;

use graph::blockchain::client::ChainClient;
use graph::blockchain::BlockHash;
use graph::blockchain::ChainIdentifier;
Expand All @@ -22,14 +26,11 @@ use graph::prelude::ethabi::Token;
use graph::prelude::tokio::try_join;
use graph::prelude::web3::types::U256;
use graph::slog::o;
use graph::tokio::sync::RwLock;
use graph::tokio::time::timeout;
use graph::{
blockchain::{block_stream::BlockWithTriggers, BlockPtr, IngestorError},
prelude::{
anyhow::{self, anyhow, bail, ensure, Context},
async_trait, debug, error, ethabi, hex, info, retry, serde_json as json, tiny_keccak,
trace, warn,
debug, error, ethabi, hex, info, retry, serde_json as json, tiny_keccak, trace, warn,
web3::{
self,
types::{
Expand Down Expand Up @@ -1653,6 +1654,7 @@ impl EthereumAdapterTrait for EthereumAdapter {

let (mut resps, missing) = cache
.get_calls(&reqs, block_ptr)
.await
.map_err(|e| error!(logger, "call cache get error"; "error" => e.to_string()))
.unwrap_or_else(|_| (Vec::new(), reqs));

Expand Down Expand Up @@ -1729,7 +1731,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
.iter()
.map(|block| block as &dyn graph::blockchain::Block)
.collect();
if let Err(e) = chain_store.upsert_light_blocks(block_refs.as_slice()) {
if let Err(e) = chain_store.upsert_light_blocks(block_refs.as_slice()).await {
error!(logger, "Error writing to block cache {}", e);
}
blocks.extend(new_blocks);
Expand Down Expand Up @@ -2367,7 +2369,7 @@ async fn fetch_individual_receipts_with_retry(
}

// Use a stream to fetch receipts individually
let hash_stream = graph::tokio_stream::iter(hashes);
let hash_stream = tokio_stream::iter(hashes);
let receipt_stream = hash_stream
.map(move |tx_hash| {
fetch_transaction_receipt_with_retry(
Expand All @@ -2379,7 +2381,7 @@ async fn fetch_individual_receipts_with_retry(
})
.buffered(ENV_VARS.block_ingestor_max_concurrent_json_rpc_calls);

graph::tokio_stream::StreamExt::collect::<Result<Vec<Arc<TransactionReceipt>>, IngestorError>>(
tokio_stream::StreamExt::collect::<Result<Vec<Arc<TransactionReceipt>>, IngestorError>>(
receipt_stream,
)
.await
Expand Down Expand Up @@ -2672,7 +2674,6 @@ mod tests {
};
use graph::blockchain::BlockPtr;
use graph::prelude::ethabi::ethereum_types::U64;
use graph::prelude::tokio::{self};
use graph::prelude::web3::transports::test::TestTransport;
use graph::prelude::web3::types::{Address, Block, Bytes, H256};
use graph::prelude::web3::Web3;
Expand Down Expand Up @@ -2720,7 +2721,7 @@ mod tests {
);
}

#[tokio::test]
#[graph::test]
async fn test_check_block_receipts_support() {
let mut transport = TestTransport::default();

Expand Down
15 changes: 10 additions & 5 deletions chain/ethereum/src/ingestor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{chain::BlockFinality, ENV_VARS};
use crate::{EthereumAdapter, EthereumAdapterTrait as _};
use async_trait::async_trait;
use graph::blockchain::client::ChainClient;
use graph::blockchain::BlockchainKind;
use graph::components::network_provider::ChainName;
Expand All @@ -9,8 +10,8 @@ use graph::{
blockchain::{BlockHash, BlockIngestor, BlockPtr, IngestorError},
cheap_clone::CheapClone,
prelude::{
async_trait, error, ethabi::ethereum_types::H256, info, tokio, trace, warn, ChainStore,
Error, EthereumBlockWithCalls, LogCode, Logger,
error, ethabi::ethereum_types::H256, info, tokio, trace, warn, ChainStore, Error,
EthereumBlockWithCalls, LogCode, Logger,
},
};
use std::{sync::Arc, time::Duration};
Expand Down Expand Up @@ -43,8 +44,12 @@ impl PollingBlockIngestor {
})
}

fn cleanup_cached_blocks(&self) {
match self.chain_store.cleanup_cached_blocks(self.ancestor_count) {
async fn cleanup_cached_blocks(&self) {
match self
.chain_store
.cleanup_cached_blocks(self.ancestor_count)
.await
{
Ok(Some((min_block, count))) => {
if count > 0 {
info!(
Expand Down Expand Up @@ -256,7 +261,7 @@ impl BlockIngestor for PollingBlockIngestor {
}

if ENV_VARS.cleanup_blocks {
self.cleanup_cached_blocks()
self.cleanup_cached_blocks().await
}

tokio::time::sleep(self.polling_interval).await;
Expand Down
Loading