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

Limit network actions to tracked chains (in main) #2393

Merged
merged 13 commits into from
Aug 28, 2024
Prev Previous commit
Next Next commit
Track newly created chains
Ensure that chains that the client open are tracked.
jvff committed Aug 27, 2024
commit 0ae1b410d1a07a4ea8b44acb526b4c629ac15193
6 changes: 6 additions & 0 deletions linera-core/src/client.rs
Original file line number Diff line number Diff line change
@@ -2519,6 +2519,12 @@ where
executed_block.message_id_for_operation(0, OPEN_CHAIN_MESSAGE_INDEX)
})
.ok_or_else(|| ChainClientError::InternalError("Failed to create new chain"))?;
// Add the new chain to the list of tracked chains
self.client.track_chain(ChainId::child(message_id));
self.client
.local_node
.retry_pending_cross_chain_requests(self.chain_id)
.await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not even sure we always want that. E.g. the faucet probably shouldn't track all its children. Maybe it's better to default to not doing that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of what we discussed offline: for most users it makes sense to track child chains they create. For the Faucet it's not great, but not tracking them would increase the size of its outboxes, which could be less scalable.

Copy link
Contributor

@ma2bd ma2bd Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure: By "tracking" here, do you mean subscribing to notifications or just allowing a local chain state to exist?

(found the answer I think)

return Ok(ClientOutcome::Committed((message_id, certificate)));
}
}