When users call depositTokens
to bridge their NFTs to L2, they can provide any amount of msg.value
as the fee for the execution. This could become problematic, as the bridging process may frequently fail due to insufficient fees.
It can be observed that depositTokens
will accept any amount of fee (msg.value
) and send the L1 -> L2 message to the StarkNet core address.
StarkNet core address will accept any non 0 msg.value
as long as it not exceed max fee.
To understand the potential issue, let's first examine how L1 -> L2 messaging is executed and how the fee is deducted.
After the transaction from L1 is send to the L2, then sequencer executed the target function with l1_handler
on the L2 target contract. The sequencer will add the execution to the proof, then will include it in Core contract state update on L1. Then the message is cleared from the Core Contract’s storage to consume the message. The sequencer charges the fee in full upon updating the L1 state with the consumption of this message.
The fee that will be charged is calculated using the same method as regular L2 transactions. This means that if there is more computation or operation on the L2 side (such as providing multiple token IDs), a larger fee will need to be provided when calling sendMessageToL2
.
reference : here
it is part of the StarkNet roadmap to implement and enforce proper fees for executing L1 to L2 transactions.
Not providing correct fee could cause execution on L2 to fail.
Manual review
Provide a proper minimum fee check when depositTokens
is called.
Impact: Medium/High. Need an admin to start a cancellation and wait for 5 days once done. DoS > 5 days. Likelyhood: Low. Everytime a wallet/or a user do not send enough gas
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.