-
Notifications
You must be signed in to change notification settings - Fork 2
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
Ronin Task Process #1
Comments
2. Correct the signing typed data waybridge-v2/internal/task/ronin.go Lines 270 to 284 in 8baa30a
Recommendation:receipt := ronEvent.Receipt
typedData := apitypes.TypedData{
Types: apitypes.Types{
"Receipt": []apitypes.Type{
{ Name: "id", Type: "uint256" },
{ Name: "kind", Type: "uint8" },
{ Name: "mainchain", Type: "TokenOwner" },
{ Name: "ronin", Type: "TokenOwner" },
{ Name: "info", Type: "TokenInfo" },
},
"TokenOwner": []apitypes.Type{
{ Name: "addr", Type: "address" },
{ Name: "tokenAddr", Type: "address" },
{ Name: "chainId", Type: "uint256" },
},
"TokenInfo": []apitypes.Type{
{ Name: "erc", Type: "uint8" },
{ Name: "id", Type: "uint256" },
{ Name: "quantity", Type: "uint256" },
},
},
Domain: apitypes.TypedDataDomain{
Name: "MainchainGatewayV2",
Version: "2",
ChainId, // Mainchain network id. Set to `receipt.mainchain.chainId`
VerifyingContract: mainchainGatewayAddr, // Please set to the mainchain gateway contract address
},
PrimaryType: "Receipt",
Message: receipt,
} Double check
{
name: 'MainchainGatewayV2',
version: '2',
chainId: 1,
verifyingContract: '0x2cEB55a827257a3563a8382CC92f932B0B4c072f'
}
{
id: 0,
kind: 0,
mainchain: {
addr: '0x057B3862d021f8931c96f789f2A7c4d3eA3C665f',
tokenAddr: '0x8DdBb1105325a27931be0515E174aC0B84E86671',
chainId: 1
},
ronin: {
addr: '0x057B3862d021f8931c96f789f2A7c4d3eA3C665f',
tokenAddr: '0x8DdBb1105325a27931be0515E174aC0B84E86671',
chainId: 1
},
info: { erc: 0, id: 0, quantity: 1 }
}
|
3. Consider checking the receipt between which emitted event and which stored in the databasebridge-v2/internal/listener/ronin.go Lines 77 to 81 in 8baa30a
This will reject handling WithdrawalRequested and WithdrawalSignaturesRequested events when they are found in the database.In some cases, the receipt in the database is not correct (due to reorg?) but when the service receives the WithdrawalSignaturesRequested events and skips them instead of providing the signatures for the correct receipts, - the withdrawals can be stuck.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1. The number of tasks when sending can be optimized
bridge-v2/internal/task/ronin.go
Lines 109 to 116 in 8baa30a
We are collecting the maximum number of
defaultLimitRecords
tasks and then filtering them as deposit tasks, withdrawal tasks, and mainchain withdrawal tasks,... This causes the number of tasks in a transaction to be not optimized (less thandefaultLimitRecords
).We can select tasks by task type with the maximum number of
defaultLimitRecords
and then send them before moving to the other task types - as the old bridge does:https://github.com/axieinfinity/bridge/blob/aa7bbb3b4ffb993341349a2cf8ed9254c62c8a50/src/task/task_sender.rs#L211-L221
The text was updated successfully, but these errors were encountered: