-
Notifications
You must be signed in to change notification settings - Fork 32
delete by prefix rfc #39
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Yoni <[email protected]>
[summary]: #summary | ||
|
||
This RFC proposes an additional API to transaction context, | ||
context.deletePrefix(address_prefix) which will get an address prefix as input |
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.
Can we extend existing API and allow partial address?
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.
We could.
I thought in order to prevent TP developers from deleting prefix by mistake, the right approach will be to add a new API for this instead of adding capabilities to existing delete API.
Do you think it will be better to allow delete with prefix by extending existing API?
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.
Yes, this can however be controlled by outputs field in TransactionHeader.
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.
What would extending the existing API look like?
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.
@yoni-wolf please correct me, but I think that would look like the existing state delete call would take a list of address prefixes rather than a list of addresses. The validator would then need to distinguish each element of the list as between a full 70 character address as a single address or something less than 70 as a prefix.
Combining this: https://github.com/hyperledger/sawtooth-core/blob/master/protos/state_context.proto#L66-L70
With this: https://github.com/hyperledger/sawtooth-core/blob/master/protos/state_context.proto#L66-L70
@vaporos if that's not what you were asking please elaborate.
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.
Clarification was that this option should be included in the alternatives section.
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.
Added to the alternative section the option to use existing API instead of adding a new API
Signed-off-by: Yoni <[email protected]>
# Prior art | ||
[prior-art]: #prior-art | ||
|
||
Access address by prefix is a key capability of radix tree. |
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.
This is worded badly. In fact, I don't know that I would go so far as to even include prior art, since it is an extension of current Sawtooth - the Merkle-Radix trie - which that functionality made use of prior art.
Signed-off-by: Yoni <[email protected]>
Signed-off-by: Yoni <[email protected]>
In several places it looks like two paragraphs are touching and it's not clear if they are meant to be separate paragraphs or whether it's one paragraph with sloppy line wrapping. In several places Sawtooth should be capitalized. |
Signed-off-by: ywolf <[email protected]>
Signed-off-by: Yoni [email protected]