-
Notifications
You must be signed in to change notification settings - Fork 13
simulateBundle helpers + JSON RPC lib from #51 #57
base: main
Are you sure you want to change the base?
Conversation
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.
I looked really hard for something to nit pick about, but couldn't find anything.
LGTM. Send it :)
While doing some integration testing, I noticed that the JSON encoder lib is using a LOT of gas. I have to set my gas limit to 30M for one CCR that JSON-encodes 10 (each) simBundle & sendBundle payloads. When the CCR lands, it only ends up using about 36k gas. But if I don't set the limit extremely high, I get an out of gas error. Is this OK? I wonder if it would be better to do the JSON encoding offchain to avoid this, or maybe there's a way to tweak the gas estimate logic on the backend to avoid this confusion. |
Bundle.simulateBundle(bundleObj)
: syntactical sugar to callSuave.simulateBundle(encodeSimBundle(bundleObj))
encodeSimBundle
: encodesbundleObj
forBundle.simulateBundle
you can also use the
using ... for
syntax:merged with #51 to use its JSON libraryremoved bc gas too high