-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
fix(unorderedtx): issues reported in audit (#21467) #23727
fix(unorderedtx): issues reported in audit (#21467) #23727
Conversation
x/auth/ante/unorderedtx/manager.go
Dismissed
@@ -145,33 +146,30 @@ | |||
var txHash TxHash | |||
copy(txHash[:], buf[:txHashSize]) | |||
|
|||
m.Add(txHash, binary.BigEndian.Uint64(buf[txHashSize:])) | |||
timeStamp := binary.BigEndian.Uint64(buf[txHashSize:]) | |||
m.Add(txHash, time.Unix(int64(timeStamp), 0)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint8 Error
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.
is this ok?
…nto technicallyty/STA-117/backport-auditfix1-e2c6e
…nto technicallyty/STA-117/backport-auditfix1-e2c6e
…nto technicallyty/STA-117/backport-auditfix1-e2c6e
Co-authored-by: Alex | Interchain Labs <[email protected]>
x/auth/ante/unordered.go
Outdated
}, | ||
} | ||
|
||
const DefaultSha256Cost = 25 |
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.
i think we should doc this. What is the unit?
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.
DefaultSha256GasCost
and rename all other var uses related to this
x/auth/ante/unordered.go
Outdated
} | ||
|
||
txHash := sha256.Sum256(ctx.TxBytes()) | ||
// consume gas in all exec modes to avoid gas estimation discrepancies | ||
sdkCtx.GasMeter().ConsumeGas(d.sha256Cost, "consume gas for calculating tx hash") |
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.
One thing I want us to follow up on is "why is the default cost what it is?"
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.
x/auth/ante/unorderedtx/manager.go
Dismissed
@@ -145,33 +146,30 @@ | |||
var txHash TxHash | |||
copy(txHash[:], buf[:txHashSize]) | |||
|
|||
m.Add(txHash, binary.BigEndian.Uint64(buf[txHashSize:])) | |||
timeStamp := binary.BigEndian.Uint64(buf[txHashSize:]) | |||
m.Add(txHash, time.Unix(int64(timeStamp), 0)) |
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.
is this ok?
…nto technicallyty/STA-117/backport-auditfix1-e2c6e
@technicallyty your pull request is missing a changelog! |
b754f48
into
technicallyty/backport-6ec53aaf54-unorderedtx-part-1
Description
Closes: STA-117
backports the audit fix from e9eaefa
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...