distributeAssets() distributes rewards to confirmed stakers. It does so by first calling consolidatePendingStakes() which ensures that anyone who staked more than 24 hours (1 day) ago is eligible. The consolidatePendingStakes()
function is used at multiple places inside the protocol.
This deadline
check however is not accurate as block.timestamp
may return a past timestamp on Arbitrum and quite possibly on other L2 chains.
As the arbitrum docs explain, the block.timestamp
can return a time which is up to 24 hours earlier than the current time, which means it's possible that the block.timestamp
has had the same value since the last 24 hours.
As mentioned, block timestamps are usually set based on the sequencer's clock. Because there's a possibility that the sequencer fails to post batches on the parent chain (for example, Ethereum) for a period of time, it should have the ability to slightly adjust the timestamp of the block to account for those delays and prevent any potential reorganisations of the chain.
Note:
To limit the degree to which the sequencer can adjust timestamps, some boundaries are set, currently to 24 hours earlier than the current time, and 1 hour in the future.
Consider this:
Alice stakes at real-world time Jan-08-2024 06:42:21 AM +UTC
Arbitrum block.timestamp
is at Jan-08-2024 06:42:21 AM +UTC
too
24 hours pass
Real-world time is Jan-09-2024 06:42:21 AM +UTC
Arbitrum is lagging by 23 hours and hence outputs block.timestamp
as Jan-08-2024 07:42:21 AM +UTC
Even though Alice should be a confirmed staker now, she is considered as pending by the function consolidatePendingStakes()
. Any reward distribution she was eligible for when distributeAssets()
is called, is missed out.
Staker misses out on rewards and is considered in "pending" status instead of "confirmed" status.
Manual review
We can consider making use of multiple external sources which can be checked to see if there is a huge mismatch between the block.timestamp
values.
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.