Skip to content
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 and re-enable abandoned tx tracker #12533

Merged
merged 35 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bdea570
Re-enable tracker
DylanTinianov Mar 21, 2024
dc448e8
generate
DylanTinianov Mar 21, 2024
58de60a
update tracker
DylanTinianov Mar 22, 2024
f7e0d44
Merge branch 'develop' into BCI-2638-re-enable-tracker
DylanTinianov Mar 24, 2024
a81653b
fix race conditions
DylanTinianov Mar 24, 2024
4cad710
Update tracker.go
DylanTinianov Mar 24, 2024
5d2da7f
Update tracker.go
DylanTinianov Mar 24, 2024
4875df4
Ensure thread safety
DylanTinianov Mar 24, 2024
f9dbe8c
Update tracker.go
DylanTinianov Mar 24, 2024
ab3a4ee
concurrently track txes
DylanTinianov Mar 24, 2024
e6cfea4
Optimizations
DylanTinianov Mar 24, 2024
99a5ba9
Merge branch 'develop' into BCI-2638-re-enable-tracker
DylanTinianov Mar 25, 2024
41c12c8
update logging
DylanTinianov Mar 25, 2024
cc7e7d1
Merge branch 'develop' into BCI-2638-re-enable-tracker
DylanTinianov Mar 25, 2024
9268f9d
Update tracker.go
DylanTinianov Mar 26, 2024
58c2bb6
Update CHANGELOG.md
DylanTinianov Mar 26, 2024
280e12a
Update common/txmgr/tracker.go
DylanTinianov Mar 26, 2024
bd51284
Merge branch 'develop' into BCI-2638-re-enable-tracker
DylanTinianov Apr 1, 2024
554b11f
GetAbandonedTransactions
DylanTinianov Apr 3, 2024
ce6ed98
lint
DylanTinianov Apr 3, 2024
76cecf0
enabled address check
DylanTinianov Apr 3, 2024
7564bd2
Update tracker_test.go
DylanTinianov Apr 3, 2024
a40c5e6
Update tracker.go
DylanTinianov Apr 3, 2024
37c8844
Ignore confirmed txes
DylanTinianov Apr 10, 2024
68b0211
Don't resend abandoned txes
DylanTinianov Apr 10, 2024
c6b3476
Remove comment
DylanTinianov Apr 10, 2024
50d7594
Update tracker_test.go
DylanTinianov Apr 11, 2024
1cdd390
Remove unused block height
DylanTinianov Apr 16, 2024
a06b64c
changeset
DylanTinianov Apr 16, 2024
fed565a
Merge branch 'develop' into BCI-2638-re-enable-tracker
DylanTinianov Apr 16, 2024
be94745
Update tracker_test.go
DylanTinianov Apr 16, 2024
986556c
Merge branch 'BCI-2638-re-enable-tracker' of https://github.com/smart…
DylanTinianov Apr 16, 2024
f91896c
Merge branch 'develop' into BCI-2638-re-enable-tracker
DylanTinianov Apr 16, 2024
98b705f
Merge branch 'develop' into BCI-2638-re-enable-tracker
DylanTinianov Apr 17, 2024
fed4cf5
Merge branch 'develop' into BCI-2638-re-enable-tracker
prashantkumar1982 Apr 17, 2024
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
Prev Previous commit
Next Next commit
Update tracker.go
  • Loading branch information
DylanTinianov committed Apr 3, 2024
commit a40c5e6b5c97829c9a50d2b37716e08fd99cd80e
14 changes: 10 additions & 4 deletions common/txmgr/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ type Tracker[
chainID CHAIN_ID
lggr logger.Logger

lock sync.Mutex
enabledAddrs map[ADDR]bool
txCache map[int64]ADDR // cache tx fromAddress by txID
ttl time.Duration
mb *mailbox.Mailbox[int64]

lock sync.Mutex
ttl time.Duration
mb *mailbox.Mailbox[int64]

initSync sync.Mutex
wg sync.WaitGroup
chStop services.StopChan
initSync sync.Mutex
isStarted bool
}

Expand Down Expand Up @@ -267,6 +268,11 @@ func (tr *Tracker[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) handleTxesB
tr.lggr.Errorf("failed to get tx by ID: %v", err)
continue
}
if tx == nil {
tr.lggr.Warnf("tx with ID %v no longer exists, removing from tracker", id)
delete(tr.txCache, tx.ID)
DylanTinianov marked this conversation as resolved.
Show resolved Hide resolved
continue
}

switch tx.State {
case TxConfirmed:
Expand Down
Loading