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

distributed transaction management docs #276

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

distributed transaction management docs #276

wants to merge 4 commits into from

Conversation

hosie
Copy link
Contributor

@hosie hosie commented Oct 7, 2024

No description provided.

### Communication with remote endorsers

In the single node scenario described earlier in this topic, we discussed the asynchronous request / reply interface to the orchestrator. Communication with one or more remote nodes for endorsement gathering is achieved using this request / reply mechanism and reliable delivery is achieved via the "requester retries" model. There is no need to co-ordinate persistent state across requester and endorser and the endorser can remain stateless.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is contrary to assumptions previously stated (#31 (comment)). Beforehand, we were relying on the endorser never giving a different answer if asked again and we were relying on each individual endorser remembering what transactions it has endorsed to spend which states so that it could prevent 2 conflicting transactions from reaching full endorsement. However, that required the endorser to have persistence which introduces more complexity and performance limitations.

With this new simplifying assumption, there (eventually) is only one co-ordinator for all in-flight transaction that could potentially have contention for state so detection and resolution of contention can be done in memory.

High level of concurrency is defined as more than one transaction in flight for the same pente contract and therefore there is likely to be a contention for state. In the case of high level of concurrency, given that pente is a 100% endorsement model, all coordinators will detect that other nodes are coordinating transactions and will converge on an agreed single coordinator for the current in-flight transactions.

In future, it may be possible to optimse the behaviour so that multiple nodes can independently co-ordinate concurrent sequences of transactions for the same pente contract so long as transactions being coordinated by one node do not attempt to call or read private evm contracts that are called by transactions being coordinated by another node. However, that adds complexity esp. when you consider the fact that the contract(s) a transaction will call / read could change when that transaction is re-assembled. So for now, we assume that any 2 concurrent transactions in flight for the same pente contract are likely to cause state contention and will need to be coordinated by the same node.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feel like we should close this topic off with a summary on tenets vs policy.

It would be a purely academic discussion given that there is no way to override the default behaviour but may serve as a useful line in the sand to facilitate future discussion. Tenets are things that the architecture assumes to be true and policy is a behaviour that happens to be a certain case by default but could potentially be tweaked to optimise for certain domains.

Examples of tenets would be

  • pending states can only be speculatively spent by transactions being co-ordinated on the same node as the transaction that produces the state.

Examples of policy would be

  • co-ordinator selector algorithm
  • submitter selector algorithm

Signed-off-by: John Hosie <[email protected]>
@hosie hosie mentioned this pull request Oct 22, 2024
8 tasks
Copy link

github-actions bot commented Nov 7, 2024

This PR is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 7, 2024
@hosie hosie removed the stale label Nov 7, 2024
Copy link

github-actions bot commented Nov 8, 2024

This PR is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant