Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Reconsider inline cids #1457

Open
ZenGround0 opened this issue Jun 21, 2021 · 3 comments
Open

Reconsider inline cids #1457

ZenGround0 opened this issue Jun 21, 2021 · 3 comments

Comments

@ZenGround0
Copy link
Contributor

@ribasushi brought up the idea of revisiting the inline cid idea as a way to address the growing state tree. There is a lot of technical disagreement and background in this closed PR: #783.

@Stebalien
Copy link
Member

We should definitely test this, but I'm a bit skeptical that this will help with sector infos, at least. Those are already inlined into the AMT and have no sub-fields that can be inlined.

However, we could probably save a bit of space by reducing the overhead of the AMT. But not much space, in this case.

@ribasushi
Copy link
Contributor

@ZenGround0 @Stebalien @raulk bumping this again + its sibling #783 (comment)

This might be filecoin's very last chance to make a change here, as after the FEVM user-defined contracts will be anchoring to preexisting CIDs, ossifying their expected shape forever.

Moreover: with user-defined smart contracts it is very likely that a lot more small objects will be generated than before.

@Stebalien
Copy link
Member

We should definitely consider this for M2.2. One alternative to "inline" CIDs is to just "auto-inline" small objects. I did some experimentation in https://github.com/Stebalien/ipld-exp/blob/master/src/auto_link.rs and it seems feasible.

Given that, you'd write something like:

struct MyState {
    some_field: AutoLink<SomeValue>,
}

And SomeValue would get auto-inlined if smaller than some constant size.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants