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

Mx 15964 bridge service update #14

Merged
merged 8 commits into from
Nov 13, 2024
Merged

Conversation

axenteoctavian
Copy link
Contributor

@axenteoctavian axenteoctavian commented Nov 1, 2024

Update to use nonce handler v3

@axenteoctavian axenteoctavian self-assigned this Nov 1, 2024
@axenteoctavian axenteoctavian marked this pull request as ready for review November 6, 2024 14:27
@sasurobert sasurobert self-requested a review November 6, 2024 14:40
sasurobert
sasurobert previously approved these changes Nov 6, 2024
@mariusmihaic mariusmihaic self-requested a review November 12, 2024 11:11
server/cmd/server/.env Show resolved Hide resolved
server/txSender/dataFormatter.go Outdated Show resolved Hide resolved
server/txSender/factory.go Show resolved Hide resolved
server/txSender/txSender.go Outdated Show resolved Hide resolved
@@ -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
Copy link
Contributor

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...

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

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?

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 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.

Copy link
Contributor

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.

Copy link
Contributor

@mariusmihaic mariusmihaic left a 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

@axenteoctavian axenteoctavian merged commit 6bd4793 into main Nov 13, 2024
3 checks passed
@axenteoctavian axenteoctavian deleted the MX-15964-bridge-service-update branch November 13, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants