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

feat: add draft of arc-3 #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

feat: add draft of arc-3 #3

wants to merge 7 commits into from

Conversation

maancham
Copy link

No description provided.

arc-3.md Outdated Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
arc-3.md Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
arc-3.md Outdated Show resolved Hide resolved
@talalashraf
Copy link

I do not fully comprehend the purpose of the coordinator contract but when talking about it from the context of amplifiers state, my understanding is that if I want to discover all related contracts for a particular chain by its name, coordinator is (or should be) the place to go to.

Having said that, I am a bit concerned about consolidating queries for ALL information into a single contract. I see each contract as a self contained unit which should make available, all data/state, through queries contained within it. This approach seems to be creating an API contract of sorts. This would mean that if you add more state to contract x, you would now have to rollout a new version of coordinator with support for providing that state in a query used by others. I don't think this is a great idea.

@maancham
Copy link
Author

I do not fully comprehend the purpose of the coordinator contract but when talking about it from the context of amplifiers state, my understanding is that if I want to discover all related contracts for a particular chain by its name, coordinator is (or should be) the place to go to.

Having said that, I am a bit concerned about consolidating queries for ALL information into a single contract. I see each contract as a self contained unit which should make available, all data/state, through queries contained within it. This approach seems to be creating an API contract of sorts. This would mean that if you add more state to contract x, you would now have to rollout a new version of coordinator with support for providing that state in a query used by others. I don't think this is a great idea.

As far as the scope of this arc is concerned, the idea is not to consolidate all queries for all information into the coordinator contract. Rather, the goal is to provide a few (as few as possible for maintainability, not ONE) endpoints on the coordinator contract to provide two functions:

  1. Chain Discovery: Allow users to discover chains that match specific criteria using predefined filters (e.g., frozen status).
  2. Chain Configuration Lookup: Enable users to retrieve chain configuration data using either a chain name or gateway address as the identifier. Part of this ARC's scope is to define what constitutes "configuration data" that should be included in these responses.

### Detailed Risk Analysis

#### Query Performance
**Risk**: The coordinator contract needs to aggregate data from multiple sources to fulfill queries, which could lead to poor performance if data needs to be collected (pullled) during query execution.

Choose a reason for hiding this comment

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

Suggested change
**Risk**: The coordinator contract needs to aggregate data from multiple sources to fulfill queries, which could lead to poor performance if data needs to be collected (pullled) during query execution.
**Risk**: The coordinator contract needs to aggregate data from multiple sources to fulfill queries, which could lead to poor performance if data needs to be collected (pulled) during query execution.

Comment on lines +165 to +169
**Mitigation**:
- Implement a push-based state update system where contracts update their state in the coordinator
- Each contract pushes relevant state changes to the coordinator when they occur
- Coordinator maintains an up-to-date cache of all required data in its state
- Queries can be served directly from coordinator state without cross-contract communication

Choose a reason for hiding this comment

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

this would add a massive amount of complexity to the system. Do we have evidence that it is necessary?

// Pagination
struct PageConfig {
// Start after this key (None for first page)
start_after: Option<String>,

Choose a reason for hiding this comment

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

you have start_after and next_key. That sounds like the key itself would never be queried

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.

3 participants