Skip to content

Decide on NOTE_MAX_SIZE and deduplicate note scripts #2653

@PhilippGackstatter

Description

@PhilippGackstatter

One thing we could consider is to allow relatively large note script sizes but scale the fee for these superlinearly. The main reason for this is that we really need only one public note with a given script to put the full script on-chain. All subsequent notes could contain just an External MAST node referring to this script. This will be possible because the node could keep track of only the most "complete" version of the script. We will need to update some logic on the node for this - and also to provide an easy way to figure out if one MAST forest is a strict subset of another.

Originally posted by @bobbinth

I guess the main benefit is to:

  • only store full note scripts once
  • reduce the size of transactions, batches or blocks when the full note script isn't needed.

The second point requires replacing a full note script with an External node if we know it already exists or isn't needed by whoever requested it, but the first point alone could also be done purely at the node DB level without changing anything about the rest of the system, afaict.

I imagine the client would always need to download a note with a full script from the node, for transaction execution, so the node may have to provide an API that allows for that.

Context: #2651 (comment)

cc @Mirko-von-Leipzig for node visibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    feesRelated to fees.rustIssues that affect or pull requests that update Rust code

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions