Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hungry-turkeys-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/teleportr': patch
---

Fix confs_remaining calculation to prevent underflow
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
"workspaces": {
"packages": [
"packages/*",
"l2geth",
"batch-submitter",
"bss-core",
"gas-oracle",
"indexer",
"integration-tests",
"go/*",
"l2geth-exporter",
"l2geth",
"ops/docker/rpc-proxy",
"ops/docker/hardhat",
"ops/docker/go-builder",
"ops/docker/js-builder"
"ops/docker/js-builder",
"proxyd",
"teleportr"
],
"nohoist": [
"**/typechain",
Expand Down
4 changes: 2 additions & 2 deletions teleportr/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ func (s *Server) HandleTrack(

var confsRemaining uint64
if teleport.Deposit.BlockNumber+s.numConfirmations > blockNumber+1 {
confsRemaining = blockNumber + 1 -
(teleport.Deposit.BlockNumber + s.numConfirmations)
confsRemaining = teleport.Deposit.BlockNumber + s.numConfirmations -
(blockNumber + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wierd thing is I was reading this code and in my head it looked correct to me at the time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha well it looked correct to me as well when i wrote the first time 😅

}

resp := TrackResponse{
Expand Down