0xMiden / 0xMiden/protocol

Add base fee that covers nullifier, account and output note hashes

Đang mở
#1,685 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
fees kernels
Ngôn ngữ chính
Rust
Star
132
Fork
167
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
110

Mô tả

The initial fee implementation contains only the `verification_base_fee`, but we need additional ones to cover the cost of inserting nullifiers and accounts into their respective tree and notes in the block note tree and potentially data storage. I'll ignore data storage in this issue since we have discussed it the least.

There are at least two approaches we've previously discussed:
- Two separate `tree_base_fee` and `output_note_base_fee`.
- A single `hash_base_fee` that covers any kind of hashing operation.

As explained [here](https://github.com/0xMiden/miden-base/discussions/1217#discussioncomment-12589475) and [here](https://github.com/0xMiden/miden-base/discussions/1217#discussioncomment-12611386) nullifiers + accounts and output notes are independent resources and so they shouldn't be covered by the same base fee. This suggests separate base fees.

The argument for having a single fee is that, essentially, the expensive part of inserting nullifiers, account updates or notes into the block note tree are hash operations. And so a single base fee would be sufficient, at least, conceptually. Moreover, an important resource we care about is the number of cycles a transaction adds to the batch and block kernels and input/output notes contribute to this metric (see also https://github.com/0xMiden/miden-base/discussions/1217#discussioncomment-12637530), and so these would already be partially captured by the cycle-based `verification_base_fee`.

I'm honestly not sure what the better approach is, so I would default to implementing the simpler option first and if we find it is insufficient, split the `hash_base_fee` into two later.

Broken out of https://github.com/0xMiden/miden-base/issues/1673.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.