Conversation
| } | ||
| copy(methodID[:], input[:4]) | ||
| ret, err = methodIds[methodID].smFunction(evm, contract, input) | ||
| ret, err = methodIds[methodID](evm, contract, input) |
There was a problem hiding this comment.
Since methodID is dynamic, this feels a bit safer:
if method, ok := methodIds[methodID]; ok {
ret, err = method(evm, contract, input)
return ret, err
}
return nil, errors.New("Method not found")I don't love the way that the error case of "method not found" isn't returned immediately. To fix this we would check !ok in the if clause but then method isn't in context outside of the if block.
There was a problem hiding this comment.
You could define method above the check so that it is in scope afterwards. What do you think?
| var result interface{} | ||
| var err error | ||
| if msg.Method == "eth_estimateGas" { | ||
| result = 0xffffffff //Gas Limit |
There was a problem hiding this comment.
I think this may make sense to have in a global variable someplace
| return ret, err | ||
| ret, err := callStateManager(input, evm, contract) | ||
| if err != nil { | ||
| log.Error("State manager error!", err) |
There was a problem hiding this comment.
Missing the Error key here before the err. It looks like in this case it'll append nil and the formatting will look weird.
See:
Line 209 in fa42b78
|
This looks like it closes #12 as well |
|
This also looks like it breaks a test: Should be investigated before being ready for merge. Does your fix to |
This PR is to intercept calls to
eth_estimateGasand instead return a hardcoded value equal to the Gas Limit. This will drastically decrease load on our Geth node, and solves a bug where eth_estimateGas was reverting because it was going over the block gas limit (we do still need to figure out what was causing this).Question - does this have any negative downstream effects wrt fees or gas metering?