-
Notifications
You must be signed in to change notification settings - Fork 108
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
Invalid transaction signature when its VALID on quoted repost with Node key #264
Comments
@donhardman can you provide the transaction before you converted to hex please? |
Here is binary transaction |
@donhardman - your extra data keys are not sorted alphabetically. In order to properly serialize the transaction, we sort the keys of the extra data object and then encode them in sorted order. Can you try sorting the keys and let me know if the issue persists? |
Ohhh. So you mean we need to sort it bulid tx in bin format and ONLY AFTER that sign it? Am I right? |
So final tx is sorted and converted to bytes when it's checked with signature, right? Thats why it's invalid in core, and really valid in real life |
We will try and I will back during a day with results. Thanks! Dont you think this sorting is really important? I mean why just to not respect original order, it's just map? |
@donhardman - I need to see some code on how you're constructing transaction to really understand what's happening. Without code, I'm missing some details. When a transaction is converted to bytes, we order the extra data keys so that transactions are serialized the same by all nodes. |
OK seems like sorting extra data keys before building the transaction solved the issue. Thanks for helping to figure it out! But anyway. But I guess it should be a kind of check on top of consensus that will reject transactions with non-alphabetical sorting in extra data. As for now, it says that the signature is incorrect just because of rebuilding bytes for the signature check. Cheers. |
This transaction has a valid signature, but the core says it's invalid.
We tried to do the same, but WITHOUT an extra data key (Node) passed, and the transaction passed through.
So my thoughts are somehow, when transaction parsed/converted to bytes again feels like the Node key missed and the signature checked using a wrong hash. But it's just thought from pattern we can see. Maybe wrong, but the issue persists when Node extra data key is presented in transaction.
Here is the transaction (inputs may or not be spent)
The result of submitting it
It works when we are doing a normal post with Node extra key. When do quoted post with Node extra key – never works! We manually build transactions, so we take the signature of full hex with all data in without reparsing it.
The text was updated successfully, but these errors were encountered: