Skip to content

Commit 9c5125d

Browse files
committed
all: Remove unused node_id from a few places
1 parent f29aecd commit 9c5125d

File tree

8 files changed

+3
-23
lines changed

8 files changed

+3
-23
lines changed

chain/ethereum/src/chain.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use graph::{
3333
firehose,
3434
prelude::{
3535
async_trait, o, serde_json as json, BlockNumber, ChainStore, EthereumBlockWithCalls,
36-
Logger, LoggerFactory, NodeId,
36+
Logger, LoggerFactory,
3737
},
3838
};
3939
use prost::Message;
@@ -214,7 +214,6 @@ impl BlockStreamBuilder<Chain> for EthereumStreamBuilder {
214214
Ok(Box::new(PollingBlockStream::new(
215215
chain_head_update_stream,
216216
Arc::new(adapter),
217-
chain.node_id.clone(),
218217
deployment.hash,
219218
filter,
220219
start_blocks,
@@ -334,7 +333,6 @@ impl RuntimeAdapterBuilder for EthereumRuntimeAdapterBuilder {
334333
pub struct Chain {
335334
logger_factory: LoggerFactory,
336335
pub name: ChainName,
337-
node_id: NodeId,
338336
registry: Arc<MetricsRegistry>,
339337
client: Arc<ChainClient<Self>>,
340338
chain_store: Arc<dyn ChainStore>,
@@ -361,7 +359,6 @@ impl Chain {
361359
pub fn new(
362360
logger_factory: LoggerFactory,
363361
name: ChainName,
364-
node_id: NodeId,
365362
registry: Arc<MetricsRegistry>,
366363
chain_store: Arc<dyn ChainStore>,
367364
call_cache: Arc<dyn EthereumCallCache>,
@@ -379,7 +376,6 @@ impl Chain {
379376
Chain {
380377
logger_factory,
381378
name,
382-
node_id,
383379
registry,
384380
client,
385381
chain_store,

chain/ethereum/src/polling_block_stream.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use graph::blockchain::block_stream::{
1313
};
1414
use graph::blockchain::{Block, BlockPtr, TriggerFilterWrapper};
1515
use graph::futures03::{stream::Stream, Future, FutureExt};
16-
use graph::prelude::{DeploymentHash, NodeId, BLOCK_NUMBER_MAX};
16+
use graph::prelude::{DeploymentHash, BLOCK_NUMBER_MAX};
1717
use graph::slog::{debug, info, trace, warn, Logger};
1818

1919
use graph::components::store::BlockNumber;
@@ -74,7 +74,6 @@ enum ReconciliationStep {
7474

7575
struct PollingBlockStreamContext {
7676
adapter: Arc<TriggersAdapterWrapper<Chain>>,
77-
node_id: NodeId,
7877
subgraph_id: DeploymentHash,
7978
// This is not really a block number, but the (unsigned) difference
8079
// between two block numbers
@@ -96,7 +95,6 @@ impl Clone for PollingBlockStreamContext {
9695
fn clone(&self) -> Self {
9796
Self {
9897
adapter: self.adapter.clone(),
99-
node_id: self.node_id.clone(),
10098
subgraph_id: self.subgraph_id.clone(),
10199
reorg_threshold: self.reorg_threshold,
102100
filter: self.filter.clone(),
@@ -133,7 +131,6 @@ impl PollingBlockStream {
133131
pub fn new(
134132
chain_head_update_stream: ChainHeadUpdateStream,
135133
adapter: Arc<TriggersAdapterWrapper<Chain>>,
136-
node_id: NodeId,
137134
subgraph_id: DeploymentHash,
138135
filter: Arc<TriggerFilterWrapper<Chain>>,
139136
start_blocks: Vec<BlockNumber>,
@@ -151,7 +148,6 @@ impl PollingBlockStream {
151148
ctx: PollingBlockStreamContext {
152149
current_block: start_block,
153150
adapter,
154-
node_id,
155151
subgraph_id,
156152
reorg_threshold,
157153
logger,

node/src/chain.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use graph::blockchain::{
1717
use graph::cheap_clone::CheapClone;
1818
use graph::components::network_provider::ChainName;
1919
use graph::components::store::{BlockStore as _, ChainHeadStore};
20-
use graph::data::store::NodeId;
2120
use graph::endpoint::EndpointMetrics;
2221
use graph::env::{EnvVars, ENV_VARS};
2322
use graph::firehose::{FirehoseEndpoint, SubgraphLimit};
@@ -353,7 +352,6 @@ pub async fn create_ethereum_networks_for_chain(
353352
pub async fn networks_as_chains(
354353
config: &Arc<EnvVars>,
355354
blockchain_map: &mut BlockchainMap,
356-
node_id: &NodeId,
357355
logger: &Logger,
358356
networks: &Networks,
359357
store: Arc<BlockStore>,
@@ -464,7 +462,6 @@ pub async fn networks_as_chains(
464462
let chain = ethereum::Chain::new(
465463
logger_factory.clone(),
466464
chain_id.clone(),
467-
node_id.clone(),
468465
metrics_registry.clone(),
469466
chain_store.cheap_clone(),
470467
call_cache,

node/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ async fn main_inner() {
315315
let blockchain_map = network_adapters
316316
.blockchain_map(
317317
&env_vars,
318-
&node_id,
319318
&logger,
320319
block_store,
321320
&logger_factory,

node/src/manager/commands/run.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ pub async fn run(
129129
networks
130130
.blockchain_map(
131131
&env_vars,
132-
&node_id,
133132
&logger,
134133
block_store,
135134
&logger_factory,

node/src/network_setup.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use graph::{
2020
log::factory::LoggerFactory,
2121
prelude::{
2222
anyhow::{anyhow, Result},
23-
info, Logger, NodeId,
23+
info, Logger,
2424
},
2525
slog::{o, warn, Discard},
2626
};
@@ -400,7 +400,6 @@ impl Networks {
400400
pub async fn blockchain_map(
401401
&self,
402402
config: &Arc<EnvVars>,
403-
node_id: &NodeId,
404403
logger: &Logger,
405404
store: Arc<BlockStore>,
406405
logger_factory: &LoggerFactory,
@@ -412,7 +411,6 @@ impl Networks {
412411
networks_as_chains(
413412
config,
414413
&mut bm,
415-
node_id,
416414
logger,
417415
self,
418416
store,

tests/src/fixture/ethereum.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ pub async fn chain(
4040
mock_registry,
4141
chain_store,
4242
firehose_endpoints,
43-
node_id,
4443
} = CommonChainConfig::new(test_name, stores).await;
4544

4645
let client = Arc::new(ChainClient::<Chain>::new_firehose(firehose_endpoints));
@@ -53,7 +52,6 @@ pub async fn chain(
5352
let chain = Chain::new(
5453
logger_factory,
5554
stores.network_name.clone(),
56-
node_id,
5755
mock_registry,
5856
chain_store.cheap_clone(),
5957
chain_store,

tests/src/fixture/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ struct CommonChainConfig {
8787
mock_registry: Arc<MetricsRegistry>,
8888
chain_store: Arc<ChainStore>,
8989
firehose_endpoints: FirehoseEndpoints,
90-
node_id: NodeId,
9190
}
9291

9392
impl CommonChainConfig {
@@ -96,7 +95,6 @@ impl CommonChainConfig {
9695
let mock_registry = Arc::new(MetricsRegistry::mock());
9796
let logger_factory = LoggerFactory::new(logger.cheap_clone(), None, mock_registry.clone());
9897
let chain_store = stores.chain_store.cheap_clone();
99-
let node_id = NodeId::new(NODE_ID).unwrap();
10098

10199
let firehose_endpoints =
102100
FirehoseEndpoints::for_testing(vec![Arc::new(FirehoseEndpoint::new(
@@ -116,7 +114,6 @@ impl CommonChainConfig {
116114
mock_registry,
117115
chain_store,
118116
firehose_endpoints,
119-
node_id,
120117
}
121118
}
122119
}

0 commit comments

Comments
 (0)