-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
txmgr.go
563 lines (505 loc) · 18.6 KB
/
txmgr.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
package txmgr
import (
"context"
"fmt"
"math/big"
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/smartcontractkit/sqlx"
"golang.org/x/exp/maps"
txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types"
commontypes "github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/assets"
evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client"
evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/services"
"github.com/smartcontractkit/chainlink/v2/core/services/pg"
"github.com/smartcontractkit/chainlink/v2/core/utils"
)
// For more information about the Txm architecture, see the design doc:
// https://www.notion.so/chainlink/Txm-Architecture-Overview-9dc62450cd7a443ba9e7dceffa1a8d6b
// ResumeCallback is assumed to be idempotent
type ResumeCallback func(id uuid.UUID, result interface{}, err error) error
// TxManager is the main component of the transaction manager.
// It is also the interface to external callers.
//
//go:generate mockery --quiet --recursive --name TxManager --output ./mocks/ --case=underscore --structname TxManager --filename tx_manager.go
type TxManager[
CHAIN_ID txmgrtypes.ID,
HEAD commontypes.Head[BLOCK_HASH],
ADDR commontypes.Hashable,
TX_HASH commontypes.Hashable,
BLOCK_HASH commontypes.Hashable,
R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH],
SEQ txmgrtypes.Sequence,
FEE txmgrtypes.Fee,
ADD any,
] interface {
txmgrtypes.HeadTrackable[HEAD, BLOCK_HASH]
services.ServiceCtx
Trigger(addr ADDR)
CreateEthTransaction(newTx txmgrtypes.NewTx[ADDR, TX_HASH], qopts ...pg.QOpt) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD], err error)
GetForwarderForEOA(eoa ADDR) (forwarder ADDR, err error)
RegisterResumeCallback(fn ResumeCallback)
SendEther(chainID *big.Int, from, to ADDR, value assets.Eth, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD], err error)
Reset(f func(), addr ADDR, abandon bool) error
}
type reset struct {
// f is the function to execute between stopping/starting the
// EthBroadcaster and EthConfirmer
f func()
// done is either closed after running f, or returns error if f could not
// be run for some reason
done chan error
}
type Txm[
CHAIN_ID txmgrtypes.ID,
HEAD commontypes.Head[BLOCK_HASH],
ADDR commontypes.Hashable,
TX_HASH commontypes.Hashable,
BLOCK_HASH commontypes.Hashable,
R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH],
SEQ txmgrtypes.Sequence,
FEE txmgrtypes.Fee,
ADD any,
FEE_UNIT txmgrtypes.Unit,
] struct {
utils.StartStopOnce
logger logger.Logger
txStore txmgrtypes.TxStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]
db *sqlx.DB
q pg.Q
config EvmTxmConfig
keyStore txmgrtypes.KeyStore[ADDR, CHAIN_ID, SEQ]
eventBroadcaster pg.EventBroadcaster
chainID CHAIN_ID
checkerFactory TransmitCheckerFactory[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]
chHeads chan HEAD
trigger chan ADDR
reset chan reset
resumeCallback ResumeCallback
chStop chan struct{}
chSubbed chan struct{}
wg sync.WaitGroup
reaper *Reaper[CHAIN_ID]
resender *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE, R, ADD]
ethBroadcaster *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]
ethConfirmer *EthConfirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]
fwdMgr txmgrtypes.ForwarderManager[ADDR]
txAttemptBuilder txmgrtypes.TxAttemptBuilder[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]
nonceSyncer NonceSyncer[ADDR, TX_HASH, BLOCK_HASH]
}
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) RegisterResumeCallback(fn ResumeCallback) {
b.resumeCallback = fn
b.ethBroadcaster.SetResumeCallback(fn)
b.ethConfirmer.SetResumeCallback(fn)
}
// NewTxm creates a new Txm with the given configuration.
func NewTxm(
db *sqlx.DB,
ethClient evmclient.Client,
cfg EvmTxmConfig,
keyStore EvmKeyStore,
eventBroadcaster pg.EventBroadcaster,
lggr logger.Logger,
checkerFactory EvmTransmitCheckerFactory,
fwdMgr EvmFwdMgr,
txAttemptBuilder EvmTxAttemptBuilder,
txStore EvmTxStore,
nonceSyncer EvmNonceSyncer,
ethBroadcaster *EvmBroadcaster,
ethConfirmer *EvmConfirmer,
ethResender *EvmResender,
q pg.Q,
) *EvmTxm {
b := EvmTxm{
StartStopOnce: utils.StartStopOnce{},
logger: lggr,
txStore: txStore,
db: db,
q: q,
config: cfg,
keyStore: keyStore,
eventBroadcaster: eventBroadcaster,
chainID: ethClient.ConfiguredChainID(),
checkerFactory: checkerFactory,
chHeads: make(chan *evmtypes.Head),
trigger: make(chan common.Address),
chStop: make(chan struct{}),
chSubbed: make(chan struct{}),
reset: make(chan reset),
fwdMgr: fwdMgr,
txAttemptBuilder: txAttemptBuilder,
nonceSyncer: nonceSyncer,
ethBroadcaster: ethBroadcaster,
ethConfirmer: ethConfirmer,
resender: ethResender,
}
if cfg.TxResendAfterThreshold() <= 0 {
b.logger.Info("EthResender: Disabled")
}
if cfg.TxReaperThreshold() > 0 && cfg.TxReaperInterval() > 0 {
b.reaper = NewEvmReaper(lggr, b.txStore, cfg, ethClient.ConfiguredChainID())
} else {
b.logger.Info("EthTxReaper: Disabled")
}
return &b
}
// Start starts Txm service.
// The provided context can be used to terminate Start sequence.
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) Start(ctx context.Context) (merr error) {
return b.StartOnce("Txm", func() error {
var ms services.MultiStart
if err := ms.Start(ctx, b.ethBroadcaster); err != nil {
return errors.Wrap(err, "Txm: EthBroadcaster failed to start")
}
if err := ms.Start(ctx, b.ethConfirmer); err != nil {
return errors.Wrap(err, "Txm: EthConfirmer failed to start")
}
if err := ms.Start(ctx, b.txAttemptBuilder); err != nil {
return errors.Wrap(err, "Txm: Estimator failed to start")
}
b.wg.Add(1)
go b.runLoop()
<-b.chSubbed
if b.reaper != nil {
b.reaper.Start()
}
if b.resender != nil {
b.resender.Start()
}
if b.fwdMgr != nil {
if err := ms.Start(ctx, b.fwdMgr); err != nil {
return errors.Wrap(err, "Txm: EVMForwarderManager failed to start")
}
}
return nil
})
}
// Reset stops EthBroadcaster/EthConfirmer, executes callback, then starts them
// again
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) Reset(callback func(), addr ADDR, abandon bool) (err error) {
ok := b.IfStarted(func() {
done := make(chan error)
f := func() {
callback()
if abandon {
err = b.abandon(addr)
}
}
b.reset <- reset{f, done}
err = <-done
})
if !ok {
return errors.New("not started")
}
return err
}
// abandon, scoped to the key of this txm:
// - marks all pending and inflight transactions fatally errored (note: at this point all transactions are either confirmed or fatally errored)
// this must not be run while EthBroadcaster or EthConfirmer are running
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) abandon(addr ADDR) (err error) {
err = b.txStore.Abandon(b.chainID, addr)
return errors.Wrapf(err, "abandon failed to update eth_txes for key %s", addr.String())
}
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) Close() (merr error) {
return b.StopOnce("Txm", func() error {
close(b.chStop)
b.txStore.Close()
if b.reaper != nil {
b.reaper.Stop()
}
if b.resender != nil {
b.resender.Stop()
}
if b.fwdMgr != nil {
if err := b.fwdMgr.Close(); err != nil {
return errors.Wrap(err, "Txm: failed to stop EVMForwarderManager")
}
}
b.wg.Wait()
b.txAttemptBuilder.Close()
return nil
})
}
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) Name() string {
return b.logger.Name()
}
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) HealthReport() map[string]error {
report := map[string]error{b.Name(): b.StartStopOnce.Healthy()}
// only query if txm started properly
b.IfStarted(func() {
maps.Copy(report, b.ethBroadcaster.HealthReport())
maps.Copy(report, b.ethConfirmer.HealthReport())
maps.Copy(report, b.txAttemptBuilder.HealthReport())
})
if b.config.UseForwarders() {
maps.Copy(report, b.fwdMgr.HealthReport())
}
return report
}
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) runLoop() {
// eb, ec and keyStates can all be modified by the runloop.
// This is concurrent-safe because the runloop ensures serial access.
defer b.wg.Done()
keysChanged, unsub := b.keyStore.SubscribeToKeyChanges()
defer unsub()
close(b.chSubbed)
var stopped bool
var stopOnce sync.Once
// execReset is defined as an inline function here because it closes over
// eb, ec and stopped
execReset := func(r *reset) {
// These should always close successfully, since it should be logically
// impossible to enter this code path with ec/eb in a state other than
// "Started"
if err := b.ethBroadcaster.closeInternal(); err != nil {
b.logger.Panicw(fmt.Sprintf("Failed to Close EthBroadcaster: %v", err), "err", err)
}
if err := b.ethConfirmer.closeInternal(); err != nil {
b.logger.Panicw(fmt.Sprintf("Failed to Close EthConfirmer: %v", err), "err", err)
}
if r != nil {
r.f()
close(r.done)
}
var wg sync.WaitGroup
// two goroutines to handle independent backoff retries starting:
// - EthBroadcaster
// - EthConfirmer
// If chStop is closed, we mark stopped=true so that the main runloop
// can check and exit early if necessary
//
// execReset will not return until either:
// 1. Both EthBroadcaster and EthConfirmer started successfully
// 2. chStop was closed (txmgr exit)
wg.Add(2)
go func() {
defer wg.Done()
// Retry indefinitely on failure
backoff := utils.NewRedialBackoff()
for {
select {
case <-time.After(backoff.Duration()):
if err := b.ethBroadcaster.startInternal(); err != nil {
b.logger.Criticalw("Failed to start EthBroadcaster", "err", err)
b.SvcErrBuffer.Append(err)
continue
}
return
case <-b.chStop:
stopOnce.Do(func() { stopped = true })
return
}
}
}()
go func() {
defer wg.Done()
// Retry indefinitely on failure
backoff := utils.NewRedialBackoff()
for {
select {
case <-time.After(backoff.Duration()):
if err := b.ethConfirmer.startInternal(); err != nil {
b.logger.Criticalw("Failed to start EthConfirmer", "err", err)
b.SvcErrBuffer.Append(err)
continue
}
return
case <-b.chStop:
stopOnce.Do(func() { stopped = true })
return
}
}
}()
wg.Wait()
}
for {
select {
case address := <-b.trigger:
b.ethBroadcaster.Trigger(address)
case head := <-b.chHeads:
b.ethConfirmer.mb.Deliver(head)
case reset := <-b.reset:
// This check prevents the weird edge-case where you can select
// into this block after chStop has already been closed and the
// previous reset exited early.
// In this case we do not want to reset again, we would rather go
// around and hit the stop case.
if stopped {
reset.done <- errors.New("Txm was stopped")
continue
}
execReset(&reset)
case <-b.chStop:
// close and exit
//
// Note that in some cases EthBroadcaster and/or EthConfirmer may
// be in an Unstarted state here, if execReset exited early.
//
// In this case, we don't care about stopping them since they are
// already "stopped", hence the usage of utils.EnsureClosed.
if err := utils.EnsureClosed(b.ethBroadcaster); err != nil {
b.logger.Panicw(fmt.Sprintf("Failed to Close EthBroadcaster: %v", err), "err", err)
}
if err := utils.EnsureClosed(b.ethConfirmer); err != nil {
b.logger.Panicw(fmt.Sprintf("Failed to Close EthConfirmer: %v", err), "err", err)
}
return
case <-keysChanged:
// This check prevents the weird edge-case where you can select
// into this block after chStop has already been closed and the
// previous reset exited early.
// In this case we do not want to reset again, we would rather go
// around and hit the stop case.
if stopped {
continue
}
enabledAddresses, err := b.keyStore.EnabledAddressesForChain(b.chainID)
if err != nil {
b.logger.Criticalf("Failed to reload key states after key change")
b.SvcErrBuffer.Append(err)
continue
}
b.logger.Debugw("Keys changed, reloading", "enabledAddresses", enabledAddresses)
execReset(nil)
}
}
}
// OnNewLongestChain conforms to HeadTrackable
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) OnNewLongestChain(ctx context.Context, head HEAD) {
ok := b.IfStarted(func() {
if b.reaper != nil {
b.reaper.SetLatestBlockNum(head.BlockNumber())
}
b.txAttemptBuilder.OnNewLongestChain(ctx, head)
select {
case b.chHeads <- head:
case <-ctx.Done():
b.logger.Errorw("Timed out handling head", "blockNum", head.BlockNumber(), "ctxErr", ctx.Err())
}
})
if !ok {
b.logger.Debugw("Not started; ignoring head", "head", head, "state", b.State())
}
}
// Trigger forces the EthBroadcaster to check early for the given address
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) Trigger(addr ADDR) {
select {
case b.trigger <- addr:
default:
}
}
// CreateEthTransaction inserts a new transaction
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) CreateEthTransaction(newTx txmgrtypes.NewTx[ADDR, TX_HASH], qs ...pg.QOpt) (tx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD], err error) {
if err = b.checkEnabled(newTx.FromAddress); err != nil {
return tx, err
}
if b.config.UseForwarders() && (!utils.IsZero(newTx.ForwarderAddress)) {
fwdPayload, fwdErr := b.fwdMgr.ConvertPayload(newTx.ToAddress, newTx.EncodedPayload)
if fwdErr == nil {
// Handling meta not set at caller.
if newTx.Meta != nil {
newTx.Meta.FwdrDestAddress = &newTx.ToAddress
} else {
newTx.Meta = &txmgrtypes.TxMeta[ADDR, TX_HASH]{
FwdrDestAddress: &newTx.ToAddress,
}
}
newTx.ToAddress = newTx.ForwarderAddress
newTx.EncodedPayload = fwdPayload
} else {
b.logger.Errorf("Failed to use forwarder set upstream: %s", fwdErr.Error())
}
}
err = b.txStore.CheckEthTxQueueCapacity(newTx.FromAddress, b.config.MaxQueuedTransactions(), b.chainID, qs...)
if err != nil {
return tx, errors.Wrap(err, "Txm#CreateEthTransaction")
}
tx, err = b.txStore.CreateEthTransaction(newTx, b.chainID, qs...)
return
}
// Calls forwarderMgr to get a proper forwarder for a given EOA.
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) GetForwarderForEOA(eoa ADDR) (forwarder ADDR, err error) {
if !b.config.UseForwarders() {
return forwarder, errors.Errorf("Forwarding is not enabled, to enable set EVM.Transactions.ForwardersEnabled =true")
}
forwarder, err = b.fwdMgr.ForwarderFor(eoa)
return
}
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) checkEnabled(addr ADDR) error {
err := b.keyStore.CheckEnabled(addr, b.chainID)
return errors.Wrapf(err, "cannot send transaction from %s on chain ID %s", addr, b.chainID.String())
}
// SendEther creates a transaction that transfers the given value of ether
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD, FEE_UNIT]) SendEther(chainID CHAIN_ID, from, to ADDR, value assets.Eth, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD], err error) {
// TODO: Remove this hard-coding on evm package
if utils.IsZero(to) {
return etx, errors.New("cannot send ether to zero address")
}
etx = txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]{
FromAddress: from,
ToAddress: to,
EncodedPayload: []byte{},
Value: *value.ToInt(),
FeeLimit: gasLimit,
State: EthTxUnstarted,
ChainID: chainID,
}
err = b.txStore.InsertEthTx(&etx)
return etx, errors.Wrap(err, "SendEther failed to insert eth_tx")
}
type NullTxManager[
CHAIN_ID txmgrtypes.ID,
HEAD commontypes.Head[BLOCK_HASH],
ADDR commontypes.Hashable,
TX_HASH, BLOCK_HASH commontypes.Hashable,
R txmgrtypes.ChainReceipt[TX_HASH, BLOCK_HASH],
SEQ txmgrtypes.Sequence,
FEE txmgrtypes.Fee,
ADD any,
] struct {
ErrMsg string
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) OnNewLongestChain(context.Context, *evmtypes.Head) {
}
// Start does noop for NullTxManager.
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) Start(context.Context) error {
return nil
}
// Close does noop for NullTxManager.
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) Close() error {
return nil
}
// Trigger does noop for NullTxManager.
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) Trigger(ADDR) {
panic(n.ErrMsg)
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) CreateEthTransaction(txmgrtypes.NewTx[ADDR, TX_HASH], ...pg.QOpt) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD], err error) {
return etx, errors.New(n.ErrMsg)
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) GetForwarderForEOA(addr ADDR) (fwdr ADDR, err error) {
return fwdr, err
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) Reset(f func(), addr ADDR, abandon bool) error {
return nil
}
// SendEther does nothing, null functionality
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) SendEther(chainID *big.Int, from, to ADDR, value assets.Eth, gasLimit uint32) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD], err error) {
return etx, errors.New(n.ErrMsg)
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) Ready() error {
return nil
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) Name() string {
return "NullTxManager"
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) HealthReport() map[string]error {
return map[string]error{}
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE, ADD]) RegisterResumeCallback(fn ResumeCallback) {
}