Skip to content

Commit

Permalink
refactor tx sending
Browse files Browse the repository at this point in the history
Refactor sending evm txs so that we store the txs before sending
and are accepting of send errors. This avoids a scenario where
we send the tx, but still receive an error, perhaps because of
a bad connection or other problem with the rpc provider.

Implement a send queue so that the caller doesn't have to wait
for the send. This should speed up ticks in core if the rpc
provider is functional but slow to respond.
  • Loading branch information
buck54321 committed Sep 18, 2024
1 parent ae2fbd0 commit 61fa850
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 119 deletions.
6 changes: 5 additions & 1 deletion client/asset/eth/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,11 @@ func (contractDeployer) nodeAndRate(
return nil, nil, nil, fmt.Errorf("error creating wallet: %w", err)
}

cl, err := newMultiRPCClient(walletDir, providers, log, chainCfg, 3, net)
creds, err := walletCredentials(chainCfg.ChainID, walletDir, net)
if err != nil {
return nil, nil, nil, fmt.Errorf("error generating wallet credentials: %w", err)
}
cl, err := newMultiRPCClient(creds, providers, log, chainCfg, 3, net)
if err != nil {
return nil, nil, nil, fmt.Errorf("error creating rpc client: %w", err)
}
Expand Down
Loading

0 comments on commit 61fa850

Please sign in to comment.