-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N(e)RD kernels #47
N(e)RD kernels #47
Conversation
Very nice job writing this. I can't comment on the technical specification other than that it reads VERY clear. 👍 One thought I had as I was reviewing is that it might be worth while to justify the 7 day maximum (relative_height <= 10,080) a bit better, i.e. why does this cover all proposed use cases, what is the trade-off for allowing a larger maximum, and why should it not be made smaller. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reading, I did a quick typo check first.
@quentinlesceller Thanks for review so far. I'll work through these and update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, very elegant implementation of relative locks.
In this proposal each NRD kernel is only inhibited by the presence of another NRD kernel with the same excess. Did you consider the possibility of inhibiting by any type of kernel (of the same excess)? I am not entirely sure it would enable new usecases, but I can see it being more general in that you don't have to know at tx construction time whether or not you would like to be able to refer to its kernel in the future. The obvious downside of this is that we would have to index every kernel for a period of 2 weeks instead of only NRD kernels..
The only use case we identified for relative kernels where absolute ones do not suffice, is the construction of unknown-future-time transactions A and B where B spends A's output unless it get revoked in time. To justify the higher implementation costs of what I'll call NoRecentSameCommitment, we would need to think of a convincing use case not handled by NRD. Having an unrestricted kernel for A with the same commitment as an NRD kernel for B presents an even bigger problem, in that transaction B can just swap out the NRD kernel for the A kernel and proceed without delay, possibly with cut-through in the same block. |
Yes. I do like it being more general, but comes at the cost of the index needing to be general also. We also briefly considered the inverse of this -
@tromp argued against this in terms of kernels restricting themselves vs. other kernels. |
Yes agreed. But this seems like a more general case of the "shorten the lock by replacing the NRD kernel with another NRD kernel". Although the cut-through does appear to make this more fragile. |
In PIBD, the result of downloading a subrange of blocks should be all the MMR data plus a list of head and tail NRD constraints, generated from the presence of NRD kernels near the start and end of the range respectively. Then, for two adjacent subranges R1 and R2, the tail NRD constraints of R1 and the head NRD constraints of R2 will need to be resolved against each other. These lists should be small so we should set the NRD kernel fee appropriately high. |
Outputs are weighted +4, inputs -1 and kernels +1 for fee calcs. Related - "absolute height locked kernels" are treated as regular kernels for fee calcs (and they contain an additional 8 bytes of height info. Edit: And block weight rules need to be decided on also. (Block weight is different to fee weight calcs). |
So I wanted to keep the consensus (block) weight rule simple. It should correspond to rough multiples of 32 bytes, so I think all kernels have weight 3, which is fine with me. |
As discussed on keybase - for simplicity we are treating NRD as the same as plain kernels for both weight and fee calcs. |
In line with our governance process, this RFC can be considered being in Final Comment Period, with a disposition to merge in two weeks time, on May 21. Please ensure any comments are made before then! |
@antiochp the FCP period has now expired and I'm happy to merge this as is. However, I had two optional points that you may want to consider before doing so:
|
|
I'll extend the FCP another two weeks from its original expiration date, until Jun 02. |
Changed my position on this. I added a section to describe NRD serialization with "fixed size kernels" and reworked the "variable size kernels" section to refer to RFC-0005 as you suggested. I think this is clearer now. 👍 |
🎉 Wohooo! This RFC has now been merged! 🤸♀️ |
Link to rendered text
Tracking issue: mimblewimble/grin#3288
Supersedes #19 "relative kernels".
No Recent Duplicate (NRD) Kernels
TODO -