-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show warning if gas exceeds 500_000, refactor state #121
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@Reinis-FRP can you verify that this gas amount returned from sim is the same gas the bot uses to threshold automatic execution |
<div | ||
class="flex flex-col w-full items-start text-left" | ||
v-if="simulationState.exceedsGasSubsidy" | ||
> | ||
<p class="text-sm"> | ||
<strong class="text-skins text-base text-red">Warning:</strong> | ||
This transaction will | ||
<strong class="underline" | ||
>not be automatically executed by oSnap.</strong | ||
> | ||
This transaction used | ||
{{ simulationState.gasUsed.toLocaleString() }} gas, which exceeds | ||
oSnap's maximum subsidized amount of | ||
{{ OSNAP_GAS_SUBSIDY.toLocaleString() }}. | ||
</p> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just removed the unnecessary div that wraps this text
</div> | ||
|
||
<TuneButton | ||
class="group text-sm md:text-[18px] hover:cursor-pointer justify-center w-full flex gap-2 mx-auto items-center" | ||
:tooltip="'Reset Simulation'" | ||
@click="resetState" | ||
> | ||
Reset | ||
Reset Simulation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more explicit copy
@@ -163,39 +163,37 @@ async function simulate() { | |||
> | |||
</div> | |||
<a | |||
v-if="simulationState.simulationLink.public" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if link isn't public, don't share it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
yes, 500K is default value used by execution bot |
@@ -53,3 +56,7 @@ export function prepareTenderlySimulationPayload(props: { | |||
|
|||
return { safe: payload }; | |||
} | |||
|
|||
export function exceedsOsnapGasSubsidy(res: TenderlySimulationResult): boolean { | |||
return res.gasUsed > OSNAP_GAS_SUBSIDY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that simulation gas usage might be lower than real one due to how state overrides short-circuit the OOv3 settlement logic. The execution bot uses ethers estimateGas on oSnap executeProposal call at the time when challenge window passed, so it might be worth checking this divergence in some test runs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting we might want to implement some sort or buffer percentage.
d5fc559
into
gerhard/uma-2153-ui-render-the-tenderly-simulation-button-in-the-tx-builder
* create base component logic * update styling * validate payload, handle request and update styles * better mobile styles * use separate reset button * feat: show warning if gas exceeds 500_000, refactor state (#121) * feat: add simulation in proposal view (#122) * feat: fetch implementation abi in transaction builder for proxy contracts (#124) * use isValid flag to check transactions in simulation * better feedback for EOA in "to" field & ABI with no write functions * clean up * reset parameters if ABI changes * revert extra green & red variables * fix typo * use better icon convention --------- Co-authored-by: Gerhard Steenkamp <[email protected]> Co-authored-by: Gerhard Steenkamp <[email protected]>
closes UMA-2168
closes UMA-2336
motivation
oSnap will only subsidize 500_000 gas and execute transaction automatically. We want to show users a warning if their transaction is exceeding this limit.
screenshots