-
Notifications
You must be signed in to change notification settings - Fork 194
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
Proposal: Extending the Filesystem of World #456
Comments
TL;DR: I agree paving the way for more file types is interesting and important to integrate while working on the foundations. Have left some thoughts on implementation details like the FileTable and access control below.
In the current approach the
I generally like the approach of making more file types possible. One thing on my mind is whether we would check the
I agree this is confusing, and it's unintended. It is possible because of
Agree this is interesting, @holic probably has thoughts on how to best integrate something like |
Introduction
The World has an implicit filesystem described with Routes. In this Filesystem, two types of "files" are stored: Tables and Systems.
Currently, the Filesystem is used to facilitate two features:
As planned in #393 (World framework), nested routes are used to proxy write access (ie: Systems having access to the parent route of a Table or System in a child route can call / write them). This is however not currently implemented.
I propose three modifications to the Filesystem:
1) Rename subRoute to File and store all File related data into a FileTable
I have found subRoute to be a confusing name; and I propose renaming it to File to match expectations. This change -- combined with adding file types -- turns the current pseudo-Filesystem into something more akin to a traditional filesystem.
An initial FileTable schema could look like such:
uint256
)string
uint256
)uint256
(stores an address for all file type but the TABLE one, where it instead stores the Schema)DELEGATECALL
,CALL
,TABLE
,ASSET
2) Add file types to differentiate between directories (a File that contains other files), Systems, and Tables.
Currently, file types are implicit; and different types of resources can have the same full-name (eg: there can be a system at
/mudswap/SwapSystem
and a table at/mudswap/SwapSystem
, which is IMO very confusing).I propose creating a unified FileTable which enforces unique File names, even if the Filetype is different.
Enforcing unique names across different file types mean we can drop the file type when operating over files.
The initial set of proposed file types are found in the Appendix: Description of the file types
3) Add one additional file type
There is a case to be made for non-executable data stored in the filesystem. Additionally, we should pave the way for more file types than the ones we have right now.
I propose adding one additional file types over the three implicit ones existing (Folder, System, and Table)
ASSET
: a piece of data stored under an address with SSTORE2 that is not executable.This would allow each World to store static files in the style EthFS.
Systems will be able to write to these files (in practice: deploy a new contract and change the
content
field of the file to the new address). This can be used by clients to load assets from the chain.Appendix: Description of the file types
FOLDER
: a file that can be used as a baseRoute. created withcreatedFolder
(currentregisterRoute
)SYSTEM
: the EVM byte code at the corresponding address will beCALL
ed called from the World (orDELEGATECALL
ed for root Systems); some context will be appended on the calldata (for now: the original msg.sender)TABLE
: a Store table, where its Schema can be found in the content column. It doesn’t have an address because it lives on the OSASSET
: anything else stored via SSTORE2 on-chain.The text was updated successfully, but these errors were encountered: