-
Notifications
You must be signed in to change notification settings - Fork 45
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: block history estimator #688
Conversation
76e322c
to
1a46fe4
Compare
lock sync.RWMutex | ||
} | ||
|
||
// NewBlockHistoryEstimator creates a new fee estimator that parses historical fees from a fetched block |
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.
// NewBlockHistoryEstimator creates a new fee estimator that parses historical fees from a fetched block | |
// NewBlockHistoryEstimator creates a new fee estimator that parses historical fees from the latest block |
@@ -148,9 +148,12 @@ func (txm *Txm) sendWithRetry(chanCtx context.Context, baseTx solanaGo.Transacti | |||
// https://github.com/gagliardetto/solana-go/blob/main/transaction.go#L252 | |||
key := baseTx.Message.AccountKeys[0].String() | |||
|
|||
// only calculate base price once |
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 bumping occurs after a new block is produced, wouldn't re-calculating the base be helpful?
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.
that's true - but there is also the possibility that the base value decreases and then the bumped value could be lower than the previous value.
only calculating the base once guarantees that the fee will always increase
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.
looks good!
157da2b
to
666b610
Compare
https://smartcontract-it.atlassian.net/browse/BCI-2811
upstream:
downstream: