Aaron/sto 1406 improve evm interactor#257
Conversation
| return fmt.Errorf("failed to get update fee: %w", err) | ||
| } | ||
| // this is the same logic as whats on the contract, but do it locally to avoid an rpc call | ||
| fee := new(big.Int).Mul(eci.singleUpdateFee, big.NewInt(int64(len(updatePayload)))) |
There was a problem hiding this comment.
nit - maybe worth making this its own function and adding a unit test for it. Kinda overkill but if we made changes to the fee logic in our contract in the future would nice to make sure they match (especially if we have to handle different versions differently etc)
| if err != nil { | ||
| eci.logger.Error().Err(err).Msg("failed to get single update fee") | ||
| } | ||
| eci.singleUpdateFee = singleUpdateFee |
There was a problem hiding this comment.
we shouldn't overwrite the singleUpdateFee with nil if the above operation fails, should just not update singleUpdateFee
| if gasFeeOverride != nil { | ||
| auth.GasFeeCap = gasFeeOverride | ||
| if eci.initialGasLimit != 0 { | ||
| auth.GasLimit = eci.initialGasLimit |
There was a problem hiding this comment.
what's initial about this gas limit? is it because of the "gas bump" thing?
There was a problem hiding this comment.
the idea is if the user passes in a value here, it should always be respected. initial prob isnt the best name for it
| return fmt.Errorf("%w: %w", errSendSyncUnsupported, err) | ||
| } | ||
|
|
||
| eci.nonce = new(big.Int).Add(eci.nonce, big.NewInt(1)) |
There was a problem hiding this comment.
nit: add a eci.incrementNonce() function
| updates := p.collateUpdates(latestContractValueMap, latestStorkValueMap, priceConfig) | ||
|
|
||
| go p.handlePushUpdates(ctx, updates, contractCh) | ||
| pushCh <- updates |
There was a problem hiding this comment.
what happens if this channel fills up? should we log error and drop updates?
No description provided.