Skip to content

Reconsider stack-allocated Blob/Cell #7952

@michaelsproul

Description

@michaelsproul

Gattaca have noted that our Blob type is slower to SSZ decode than [u8; 128k]:

The reason seems to be that our Blob is heap-allocated:

pub type Blob<E> = FixedVector<u8, <E as EthSpec>::BytesPerBlob>;

The slowdown looks crazy on a % basis, but is very small in absolute terms. 5us vs 800us. It's less than a millisecond spent decoding objects that takes 10s-100s of milliseconds to verify.

I think we originally put blobs on the heap to avoid stack overflows caused by deeply nested futures? But my memory of this is a bit hazy. If it turns out that we don't need to do this, we could reconsider using stack-allocated blobs (or, realistically just Cells).

This could be related to:

I'll look at that next.

Metadata

Metadata

Assignees

No one assigned

    Labels

    consensusAn issue/PR that touches consensus code, such as state_processing or block verification.dasData Availability Samplingmajor-taskA significant amount of work or conceptual task.optimizationSomething to make Lighthouse run more efficiently.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions