You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the technique outlined in appendix F we identified several instructions which might not be priced adequately.
One result from this evaluation is that the SRWQ instruction charges gas dependent on the parameter D, though it seems like its consumption is inadequate with respect to the execution time of this instruction. The default cost for it is right now a dependent cost with base 54 and dependent cost per unit of 2.
The SRWQ instruction contains an expensive call to merkle_contract_state_insert_range, which might be inadequately priced. The following figure contains a base64 encoded program which uses the SRWQ function and executes for several seconds.
Figure 38.1: Base64 program which uses SRWQ and consumes relatively high CPU time.
Note that this is a result of a quantitative analysis and that more benchmarking is required to validate whether the gas consumption of SRWQ is inadequate or not.
Exploit Scenario
An attacker deploys a contract which heavily uses the SRWQ instruction. With very little gas consumption the attack can put a lot of stress on the network. Depending on how much gas the attacker invests the whole network could be blocked.
Recommendations
Short term, evaluate a better value for the dependent cost of SRWQ.
Long term, reevaluate the execution time of programs using a corpus obtained through fuzzing.
The text was updated successfully, but these errors were encountered:
SRWQ only has the merkle_contract_state_range call inside. So maybe the report is related to another opcode. Or something is wrong with description of the issue for SRWQ. We need to investigate the problem during FuelLabs/fuel-core#1306. Maybe it will be fixed by FuelLabs/fuel-core#1239.
Description
Using the technique outlined in appendix F we identified several instructions which might not be priced adequately.
One result from this evaluation is that the SRWQ instruction charges gas dependent on the parameter D, though it seems like its consumption is inadequate with respect to the execution time of this instruction. The default cost for it is right now a dependent cost with base 54 and dependent cost per unit of 2.
The SRWQ instruction contains an expensive call to
merkle_contract_state_insert_range
, which might be inadequately priced. The following figure contains a base64 encoded program which uses the SRWQ function and executes for several seconds.Figure 38.1: Base64 program which uses SRWQ and consumes relatively high CPU time.
Note that this is a result of a quantitative analysis and that more benchmarking is required to validate whether the gas consumption of SRWQ is inadequate or not.
Exploit Scenario
An attacker deploys a contract which heavily uses the SRWQ instruction. With very little gas consumption the attack can put a lot of stress on the network. Depending on how much gas the attacker invests the whole network could be blocked.
Recommendations
Short term, evaluate a better value for the dependent cost of SRWQ.
Long term, reevaluate the execution time of programs using a corpus obtained through fuzzing.
The text was updated successfully, but these errors were encountered: