Submitted by t0x1c, also found by Mahi_Vasisth
The issue exists for both MainnetTierProvider.sol and TestnetTierProvider.sol. For this report, we shall concentrate only on describing it via MainnetTierProvider.sol.
The proving tier is chosen by the getMinTier() function which accepts a _rand param.
If _rand % 1000 == 0, a costlier tier TIER_SGX_ZKVM is used instead of the cheaper TIER_SGX. The _rand param is passed in the form of meta_.difficulty which is calculated inside proposeBlock():
As can be seen, all the parameters used in L204 to calculate meta_.difficulty can be known in advance and hence a proposer can choose not to propose when meta_.difficulty modulus 1000 equals zero, because in such cases it will cost him more to afford the proof (sgx + zk proof in this case).
Since the proposer will now wait for the next or any future block to call proposeBlock() instead of the current costlier one, transactions will now take longer to finalilze.
If _rand were truly random, it would have been an even playing field in all situations as the proposer wouldnt be able to pick & choose since he wont know in advance which tier he might get. We would then truly have:
Consider using VRF like solutions to make _rand truly random.
dantaik (Taiko) acknowledged and commented:
adaki2004 (Taiko) commented:
genesiscrew (Warden) commented:
adaki2004 (Taiko) commented:
t0x1c (Warden) commented:
adaki2004 (Taiko) commented:
