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

Isolate onchain data sources from accessing and modifying offchain entities #3770

Closed
leoyvens opened this issue Jul 25, 2022 · 2 comments
Closed
Assignees
Labels
offchain Offchain data sources, such as IPFS files

Comments

@leoyvens
Copy link
Collaborator

leoyvens commented Jul 25, 2022

The current implementation prevents offchain data sources prevents them from accessing the store at all. However onchain data sources are still able to read and even update entities created by offchain data sources.

The fix is to properly implement causality region isolation. Entity tables need a column that tracks their causality region. Also the in-memory representation of data sources needs to be aware of its own causality region. See #3072 for background on the design of causality region isolation.

@leoyvens leoyvens added the offchain Offchain data sources, such as IPFS files label Sep 20, 2022
@leoyvens leoyvens self-assigned this Sep 20, 2022
@mangas mangas assigned mangas and unassigned leoyvens Sep 29, 2022
@leoyvens leoyvens changed the title File data sources: Causality region isolation Isolate onchain data sources from accessing and modifying offchain entities Oct 10, 2022
@leoyvens leoyvens assigned leoyvens and unassigned mangas Oct 10, 2022
@leoyvens
Copy link
Collaborator Author

leoyvens commented Nov 9, 2022

Problem statement

For indexing results to be reproducible given a set of available files, regardless of the order in which the files are found, it is necessary to isolate the effects of processing offchain data sources. An onchain data source cannot read or update entities created by an offchain data source, and an offchain data source cannot read or update an entity created by another offchain data source.

Causality regions help us, because by assigning all onchain data sources the same causality region and each offchain data source their own causality region, we can restate the goal as: A data source cannot read or update entities from other causality regions.

The isolation rule can be further refined as read restriction and a write restriction.

  • Read restriction: An attempted read from a different causality region returns null.
  • Write restriction: An an attempted update or overwrite to an entity of a different causality region is a conflict which must raise an error.

This issue is about implementing both restrictions.

Implementation plan

The details on 3 and 4 are not clear yet, what would the best way be to get the causality region value to the store? Maybe add it to the EntityKey?

@leoyvens
Copy link
Collaborator Author

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
offchain Offchain data sources, such as IPFS files
Projects
None yet
Development

No branches or pull requests

2 participants