0xMiden / 0xMiden/protocol

Decide on `NOTE_MAX_SIZE` and deduplicate note scripts

Aperta
#2,653 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
fees rust
Lingua principale
Rust
Stelle
132
Fork
167
Merge medio
1g 23h
PR unite (30g)
110

Descrizione

> 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: https://github.com/0xMiden/protocol/issues/2651#issuecomment-4098409631

cc @Mirko-von-Leipzig for node visibility

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.