Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Process messages concurrently #288

Merged
merged 62 commits into from
Jun 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
51d4e6f
route incoming messages to appRelayer
cam-schultz Apr 29, 2024
608022c
Merge branch 'db-manager' into concurrent-messages
cam-schultz Apr 30, 2024
a1bdf87
todo comments
cam-schultz Apr 30, 2024
3b0c438
remove catch up results chan
cam-schultz Apr 30, 2024
4142101
Revert "remove catch up results chan"
cam-schultz Apr 30, 2024
01a07e3
write directly to headers chan
cam-schultz Apr 30, 2024
8cf64a6
Merge branch 'db-manager' into concurrent-messages
cam-schultz May 1, 2024
678fa92
send to channel before closing
cam-schultz May 2, 2024
e8371e3
relay messages async - wip
cam-schultz May 2, 2024
252b027
listener composed of app relayers
cam-schultz May 2, 2024
f386d11
appRelayer maintains block status
cam-schultz May 2, 2024
b5fca25
combine prepare and process height
cam-schultz May 3, 2024
34eda3f
refactor message manager and warpblockinfo
cam-schultz May 3, 2024
efa8f3b
restore integ tests
cam-schultz May 3, 2024
de411b9
combine prepare and process height
cam-schultz May 3, 2024
9f79ca1
refactor app relayer interface
cam-schultz May 3, 2024
7edff1d
noop if committed height is unchanged
cam-schultz May 10, 2024
2ee56bb
remove unused var
cam-schultz May 10, 2024
72f6f0c
fix unit tests
cam-schultz May 10, 2024
08235b7
Merge branch 'db-manager' into concurrent-messages
cam-schultz May 13, 2024
5ffa9dc
Merge branch 'concurrent-messages' into app-relayer-worker
cam-schultz May 13, 2024
90391a6
go 1.22.3
cam-schultz May 13, 2024
69dbc80
bump golangci-lint version
cam-schultz May 13, 2024
acbc62d
Merge branch 'db-manager' into concurrent-messages
cam-schultz May 14, 2024
23dd427
Merge branch 'concurrent-messages' into app-relayer-worker
cam-schultz May 14, 2024
b57d05d
add batch Teleporter message test
cam-schultz May 14, 2024
1a051f3
do not assume ordered message delivery
cam-schultz May 14, 2024
2db03ec
migrate deprecated flag
cam-schultz May 14, 2024
248c852
checkout submodules in ci
cam-schultz May 14, 2024
b5cd801
re-checkout repo
cam-schultz May 14, 2024
0930225
Merge branch 'main' into app-relayer-worker
cam-schultz May 14, 2024
4d0cd01
remove unused param
cam-schultz May 14, 2024
1cd196e
relay between subnets, no c-chain
cam-schultz May 14, 2024
7b345c6
debug logs
cam-schultz May 14, 2024
b3c5b5e
batch test requires all messages delivered
cam-schultz May 14, 2024
8dce7b4
comments+cleanup
cam-schultz May 15, 2024
359032d
Merge branch 'main' into app-relayer-worker
cam-schultz May 20, 2024
f1887c9
cleanup external handler
cam-schultz May 21, 2024
65a9162
request id mutual exclusion
cam-schultz May 21, 2024
ef461da
comments and cleanup
cam-schultz May 21, 2024
cbddf3a
rename MessageManager to MessageHandlerFactory
cam-schultz May 21, 2024
8653be1
lint
cam-schultz May 21, 2024
610105b
revert to go1.21
cam-schultz May 21, 2024
e939eca
add handleResponse helper
cam-schultz May 21, 2024
0611a3b
Update relayer/application_relayer.go
cam-schultz May 22, 2024
b920a0f
rename shadowed var
cam-schultz May 22, 2024
757f988
cleanup
cam-schultz May 22, 2024
359dde4
process blocks async
cam-schultz May 22, 2024
00a1d4e
app relayer holds a dst client
cam-schultz May 22, 2024
8ed636b
fix unit test
cam-schultz May 22, 2024
ad391aa
Merge branch 'app-relayer-worker' of github.com:ava-labs/awm-relayer …
cam-schultz May 22, 2024
d1936ec
handle app relayer errors
cam-schultz May 23, 2024
59210e0
add upgrade comment
cam-schultz May 23, 2024
f4f44e6
only lock nonce usage
cam-schultz May 23, 2024
9e55c91
Merge branch 'main' into app-relayer-worker
geoff-vball May 28, 2024
077cea1
Merge branch 'main' into app-relayer-worker
geoff-vball May 31, 2024
1782f31
Refactor application relayers
geoff-vball May 31, 2024
ba2f686
Fix typo
geoff-vball May 31, 2024
024ffd2
Merge pull request #309 from ava-labs/gstuart/concurrent-message
geoff-vball May 31, 2024
65b8ba8
Fix key truncation
geoff-vball May 31, 2024
3404bf7
lint
geoff-vball May 31, 2024
7d2f8ee
Merge branch 'main' into app-relayer-worker
geoff-vball May 31, 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
13 changes: 6 additions & 7 deletions vms/evm/destination_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ func (c *destinationClient) SendTx(signedMessage *avalancheWarp.Message,
gasLimit uint64,
callData []byte,
) error {
// Synchronize teleporter message requests to the same destination chain so that message ordering is preserved
c.lock.Lock()
defer c.lock.Unlock()

// Get the current base fee estimation, which is based on the previous blocks gas usage.
baseFee, err := c.client.EstimateBaseFee(context.Background())
if err != nil {
Expand All @@ -143,6 +139,12 @@ func (c *destinationClient) SendTx(signedMessage *avalancheWarp.Message,
gasFeeCap := baseFee.Mul(baseFee, big.NewInt(BaseFeeFactor))
gasFeeCap.Add(gasFeeCap, big.NewInt(MaxPriorityFeePerGas))

// Synchronize nonce access so that we send transactions in nonce order.
// Hold the lock until the transaction is sent to minimize the chance of
// an out-of-order transaction being dropped from the mempool.
c.lock.Lock()
defer c.lock.Unlock()

// Construct the actual transaction to broadcast on the destination chain
tx := predicateutils.NewPredicateTx(
c.evmChainID,
Expand Down Expand Up @@ -175,9 +177,6 @@ func (c *destinationClient) SendTx(signedMessage *avalancheWarp.Message,
)
return err
}

// Increment the nonce to use on the destination chain now that we've sent
// a transaction using the current value.
c.currentNonce++
c.logger.Info(
"Sent transaction",
Expand Down