Add txin base weight#2001
Conversation
fd3eb56 to
3e2550c
Compare
There was a problem hiding this comment.
No need for this change IMO, I assume it was because of the code comment on BASE_WEIGHT.
There was a problem hiding this comment.
I think you mentioned in a previous PR that developer comments go above doc comments?
There was a problem hiding this comment.
I don't remember saying so, I don't have a policy on docs/rustdocs in my mind. You could be mixing up with rustdocs above attributes, which I remember commenting on recently.
There was a problem hiding this comment.
The comment could be removed now.
d78ad66 to
c0a6a8d
Compare
|
Thanks for the review @tcharding |
c0a6a8d to
7ec33d2
Compare
|
This MR seems incorrect to me.. The inputs is 32 + 4 + 4 bytes in actual size, not weight. So it is missing a multiplier of 4.. The place it's used in it's supposed to be size to, but the Weight is just converted back to wu and interpreted as size.. |
|
Looking into the broader concept this is used in, confuses me a lot. The use of the type Especially in the case of this constant, the "base weight" of in input is definitely 4 times their base size. Because these fields are never counted as single weight units. |
|
oof @stevenroose you're right. I think the "root of the confusion" is that I looked at |
|
There's a PR which attempts to correct my mistake here: #2053 |
Feeling pretty dumb as well for missing this. |
|
Accidents happen, at least we caught it. Someone buy @stevenroose a cold drink. |
Add a base weight const to TxIn. I also used this const in strippedsize() and scaledsize(). As a different PR, I think strippedsize and scaledsize could return Weight instead of usize. Also added a small commit to re-arrange commit messages.