In a nutshell, the blockifier (the sequencer’s execution engine) charged a transaction fee that is higher than the fee agreed on by the user. Here are the details:
There are two instances of such a conversion:
There was a discrepancy in logic for these two instances: the first one rounded down while the second rounded up.
Hence, the fee submitted by the user could cover the computed amount of gas, but in fact the sequencer would charge for a larger amount of gas.
Example: user agreed to pay 1. The first check says that the compound cost is 0.99 which is good as it’s lower than the user max fee. The actual charge is 1.01 which is more than the user agreed to pay.
The Starknet OS ensures users are not charged higher fees than they agreed to pay, leading to a reorg.
The bug was in the following conversion:
blob_gas_as_regular_gas = (blob_gas_amount * blob_gas_price) / regular_gas_price
The fix:
blob_gas_as_regular_gas=(blob_gas_amount * blob_gas_price).div_ceil(regular_gas_price)
The actual incident: a transaction was charged 542202566082576
FRI while signing on the following max resources.
'L1_GAS': {'max_amount': '0x15',
'max_price_per_unit': '0x177b7e71b5d0'}
But 0x177b7e71b5d0 * 0x15 = 542202565749264
and 542202565749264 < 542202566082576. The un-rounded amount of gas after blob gas conversion was 21.0000000012 gas, yet the user signed only on 21 gas.
Blocks [630,029, 630,064] were reorganized into [630,029, 630,059].
There were fewer blocks post-reorg:
The execution of several transactions was impacted by the reorg. The vast majority of these changes in execution status was due to different ambient conditions during their post-reorg re-execution, namely block timestamps. Indeed it is customary for wallets to render their transactions invalid several hours after their first creation.
Due to the inherent separation between execution and proving phases, we are taking further steps to mitigate the effects of any potential discrepancies in the future.
ACCEPTED_ON_L2
and ACCEPTED_ON_L1
which drastically reduces any wiggle-room. In the near future, such a status will reflect successful execution of the OS. In the slightly more distant future, it will reflect the availability of a proof on L2.