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

Initial work to add an in-memory layer on top of the TxStore #11190

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c53bb4c
initial commit for inmemory implementation
poopoothegorilla Oct 31, 2023
b75d260
some cleanup
poopoothegorilla Nov 1, 2023
41a572d
Merge branch 'develop' into jtw/initial-in-memory-work
poopoothegorilla Nov 1, 2023
3dde323
fix tests
poopoothegorilla Nov 2, 2023
201a2dd
add some functions for the in memory store
poopoothegorilla Nov 6, 2023
0c1d6cf
Merge branch 'develop' into jtw/initial-in-memory-work
poopoothegorilla Nov 6, 2023
b565d45
implement a few more methods for the in memory store
poopoothegorilla Nov 6, 2023
faf670f
some clean up
poopoothegorilla Nov 7, 2023
178b0f0
add check for inprogress txn
poopoothegorilla Nov 7, 2023
fe25a26
make some changes to testing
poopoothegorilla Nov 7, 2023
a0ac2a3
reorganize tests
poopoothegorilla Nov 7, 2023
a28aa80
start initialization function; add priority queue system; change stor…
poopoothegorilla Nov 8, 2023
e2f3a87
add initialization to address state
poopoothegorilla Nov 14, 2023
91bea75
change loops to not use range
poopoothegorilla Nov 14, 2023
5314284
clean up idempotency key location
poopoothegorilla Nov 15, 2023
5a908be
add find latest sequence
poopoothegorilla Nov 15, 2023
9872283
remove FindLatestSequence from persistent interface
poopoothegorilla Nov 15, 2023
df5e946
add UnconfirmedTransactions to TxSoreWebApi
poopoothegorilla Nov 15, 2023
fcb9021
Merge branch 'develop' into jtw/initial-in-memory-work
poopoothegorilla Dec 11, 2023
5d78868
address comments
poopoothegorilla Dec 11, 2023
a0a1a79
fix tests
poopoothegorilla Dec 11, 2023
89d1056
fix bug in tests
poopoothegorilla Dec 11, 2023
3663bd0
run go generate
poopoothegorilla Dec 12, 2023
17cd10d
Merge branch 'develop' into jtw/initial-in-memory-work
poopoothegorilla Dec 12, 2023
54b7ecc
address comment
poopoothegorilla Dec 12, 2023
f8e0175
update inmemory store to implement txstore interface
poopoothegorilla Dec 12, 2023
df1a11a
cleanup tests
poopoothegorilla Dec 12, 2023
5452d02
Merge branch 'develop' into jtw/initial-in-memory-work
poopoothegorilla Dec 12, 2023
5f0f6da
Merge branch 'develop' into jtw/initial-in-memory-work
poopoothegorilla Dec 14, 2023
f24eea7
add deepcopy
poopoothegorilla Dec 14, 2023
325fb12
remove testing since this will be in future work
poopoothegorilla Jan 5, 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
2 changes: 1 addition & 1 deletion common/txmgr/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) next
defer cancel()
etx := &txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{}
if err := eb.txStore.FindNextUnstartedTransactionFromAddress(ctx, etx, fromAddress, eb.chainID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
if errors.Is(err, sql.ErrNoRows) || errors.Is(err, ErrTxnNotFound) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It feels weird to force users of txStore to check for two different error, that actually mean the same. Won't it be easier to return sql.ErrNoRows from in memory storage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to get rid of the reliance on sql.ErrNoRows so this is the first step. relying on it forces us to be dependent on the sql pkg... i think we should use our own error types for it so we can make this less dependent

// Finish. No more transactions left to process. Hoorah!
return nil, nil
}
Expand Down
Loading
Loading