Skip to content

Aaron/sto 1406 improve evm interactor#257

Merged
akawalsky merged 15 commits intomainfrom
aaron/sto-1406-improve-evm-interactor
Mar 13, 2026
Merged

Aaron/sto 1406 improve evm interactor#257
akawalsky merged 15 commits intomainfrom
aaron/sto-1406-improve-evm-interactor

Conversation

@akawalsky
Copy link
Copy Markdown
Contributor

No description provided.

@akawalsky akawalsky requested a review from harryrackmil March 12, 2026 20:46
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))))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's initial about this gas limit? is it because of the "gas bump" thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a eci.incrementNonce() function

updates := p.collateUpdates(latestContractValueMap, latestStorkValueMap, priceConfig)

go p.handlePushUpdates(ctx, updates, contractCh)
pushCh <- updates
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if this channel fills up? should we log error and drop updates?

harryrackmil
harryrackmil previously approved these changes Mar 13, 2026
@akawalsky akawalsky merged commit 9c2b18e into main Mar 13, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants