这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@gitferry
Copy link
Member

@gitferry gitferry commented Apr 7, 2025

@gitferry gitferry force-pushed the gai/skip-block-when-double-sign branch from 9e02d0a to 49be4b7 Compare April 7, 2025 12:48
@gitferry gitferry force-pushed the gai/skip-block-when-double-sign branch from 504d179 to 72d0beb Compare April 7, 2025 14:18
@gitferry gitferry marked this pull request as ready for review April 7, 2025 14:39
@gitferry gitferry force-pushed the gai/skip-block-when-double-sign branch 4 times, most recently from 57584d6 to f1d1741 Compare April 8, 2025 05:18
@gitferry gitferry force-pushed the gai/skip-block-when-double-sign branch from f1d1741 to eadcca4 Compare April 8, 2025 05:34
Copy link
Member

@Lazar955 Lazar955 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@gitferry
Copy link
Member Author

gitferry commented Apr 8, 2025

Will wait for a second approval as it's a critical one @KonradStaniec

Copy link
Contributor

@KonradStaniec KonradStaniec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good 👍 just some clarifying questions

I think next step, will be testing this change on devent ?

if len(validBlocks) == 0 {
fp.logger.Info("all blocks were skipped due to double sign errors")

return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double checking, is the calling code ready to handle nil, nil response ?

second question, if all blocks are marked as double signable shouldn't we update fp state to latest block:

highBlock := blocks[len(blocks)-1]
fp.MustUpdateStateAfterFinalitySigSubmission(highBlock.Height)

?

Copy link
Member Author

@gitferry gitferry Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double checking, is the calling code ready to handle nil, nil response ?

Yes, it is bubbled up to


I added contract in the doc string

if all blocks are marked as double signable shouldn't we update fp state to latest block

Yes, it should be set as the latest block. Isn't it what the PR does? The batch that is actually sent is validBlocks

// TestSkippingDoubleSignError tests the scenario where the finality-provider
// should skip the block when encountering a double sign request from the
// eots manager
func TestSkippingDoubleSignError(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I run e2e test I see some stacktrace being thrown:

2025-04-09T09:02:10.933+0200    ERROR   eotsmanager/localmanager.go:212 double sign requested   {"eots_pk": "f5d32d55464d5cb401d5283efd788b607cb3c1614512d93243b42da1af30a5e6", "hash": "0000000000000011b8073846dfe718a0f13840dc27688b9348ed07d0c172fd0a9eb461679ea702c3", "height": 17, "chainID": "chain-test"}
github.com/babylonlabs-io/finality-provider/eotsmanager.(*LocalEOTSManager).SignEOTS
        /Users/konradstaniec/Work/babylon/finality-provider/eotsmanager/localmanager.go:212
github.com/babylonlabs-io/finality-provider/eotsmanager/service.(*rpcServer).SignEOTS
        /Users/konradstaniec/Work/babylon/finality-provider/eotsmanager/service/rpcserver.go:69
github.com/babylonlabs-io/finality-provider/eotsmanager/proto._EOTSManager_SignEOTS_Handler
        /Users/konradstaniec/Work/babylon/finality-provider/eotsmanager/proto/eotsmanager_grpc.pb.go:221
google.golang.org/grpc.(*Server).processUnaryRPC
        /Users/konradstaniec/go/pkg/mod/google.golang.org/grpc@v1.70.0/server.go:1400
google.golang.org/grpc.(*Server).handleStream
        /Users/konradstaniec/go/pkg/mod/google.golang.org/grpc@v1.70.0/server.go:1810
google.golang.org/grpc.(*Server).serveStreams.func2.1
        /Users/konradstaniec/go/pkg/mod/google.golang.org/grpc@v1.70.0/server.go:1030
    babylon_test_manager.go:371: the fp voted at height 18

is this expected ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We log it as ERROR level.

@gitferry
Copy link
Member Author

gitferry commented Apr 9, 2025

I think next step, will be testing this change on devent ?

Probably. I was thinking how to test this scenario. In the e2e test of this PR, we stop the fp for a while and make a manual submission, then restart. We probably can do the same on devnet?

@gitferry gitferry merged commit 7cdf2a1 into main Apr 9, 2025
18 checks passed
@gitferry gitferry deleted the gai/skip-block-when-double-sign branch April 9, 2025 09:55
@KonradStaniec
Copy link
Contributor

In the e2e test of this PR, we stop the fp for a while and make a manual submission, then restart. We probably can do the same on devnet?

I would say so. This seems to be easiest way to test this scenario

gitferry added a commit that referenced this pull request Apr 9, 2025
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.

4 participants