-
Notifications
You must be signed in to change notification settings - Fork 0
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
Mx 15964 bridge service update #14
Conversation
@@ -122,9 +122,10 @@ func (ts *txSender) createAndSendTxs(ctx context.Context, data *sovereign.Bridge | |||
} | |||
default: | |||
log.Error("invalid tx data received", "data", string(txData)) | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that this is a fatal error and should not continue...
Not very sure about it, though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better than before. Previously we would send the tx with invalid tx data, this is protection to skip it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better, but I meant we should directly return error, not continue.
This is fatal, we should not skip and send "half txs"
@@ -127,7 +127,8 @@ func TestTxSender_SendTxs(t *testing.T) { | |||
}, | |||
} | |||
args.TxNonceHandler = &testscommon.TxNonceSenderHandlerMock{ | |||
ApplyNonceAndGasPriceCalled: func(ctx context.Context, address core.AddressHandler, tx *transaction.FrontendTransaction) error { | |||
ApplyNonceAndGasPriceCalled: func(ctx context.Context, txs ...*transaction.FrontendTransaction) error { | |||
require.Len(t, txs, 1) // we update transactions one at a time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe...
Should we refactor to create all txs and then send them all in bulk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I tried this and didn't work as expected, not sure if it was my bad or the sdk didn't work properly when spammed.
I'd say we keep it one at the time for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a task to check if we send them in bulk?
It's better logic anyway... have them all formatted + send them all;
Instead, right now, we can format 2/3 correct + send them, but fail for the third one...
I think it's better to use the ""all or nothing" approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 for now, we should refactor to send txs in bulk, w.r.t open comments
Update to use nonce handler v3