-
Notifications
You must be signed in to change notification settings - Fork 113
Hack to force relay commitment [DO NOT MERGE] #1437
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
base: main
Are you sure you want to change the base?
Conversation
@@ -19,7 +20,7 @@ type ScanBlocksResult struct { | |||
|
|||
func ScanBlocks(ctx context.Context, meta *types.Metadata, api *gsrpc.SubstrateAPI, startBlock uint64) (chan ScanBlocksResult, error) { | |||
results := make(chan ScanBlocksResult) | |||
go scanBlocks(ctx, meta, api, startBlock, results) | |||
go scanBlocks(ctx, meta, api, 25420890, results) |
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.
Hard code block number to 5 blocks before the block that has the bad commitment so that we can skip directly to the block we want.
@@ -108,7 +109,7 @@ func scanBlocks(ctx context.Context, meta *types.Metadata, api *gsrpc.SubstrateA | |||
} | |||
|
|||
if sessionIndex > currentSessionIndex { | |||
currentSessionIndex = sessionIndex | |||
//currentSessionIndex = sessionIndex |
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.
Do not increment the session, which essentially makes it try every block in the next session, pushing all found commitments through instead of the first commitment per session.
logrus.WithError(err).Error("scanned commitment") | ||
//emitError(fmt.Errorf("fetch commitment and proof: %w", err)) | ||
//return | ||
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.
When there is an error skip to the next commitment.
Cool! Though it seems more like a workaround. I noticed that in #1342 we removed the I'd suggest to add it back-it could be useful for scenarios like this. |
@alistair-singh #1456 is merged. So maybe we can close this PR? |
Relayer failed in live.
Basically, the proof did not match the onchain MMR root, and the relayer rejected it. On chain MMR root hash 0x2a060a3e22a31c99488a77c0e159b3e681c7057ffcadaf6d47168f84b1845355
You can reproduce with the following command:
snowbridge-relay scan-beefy -p wss://api-polkadot.dwellir.com/$DWELLIR_KEY -b 25420894
Hacked the relayer so that it would skip this commitment and move onto the next one which unblocked the relayer.