-
Notifications
You must be signed in to change notification settings - Fork 364
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
test: aggregator bump fee #1297
test: aggregator bump fee #1297
Conversation
…p-the-fee-v2' into test-aggregator-bump-fee
) external onlyAggregator { | ||
uint256 initialGasLeft = gasleft(); | ||
|
||
if (i < 4) { |
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.
You can modify this 4
to a higher value to test higher retries. Don't forget to re-deploy the contracts.
@@ -74,11 +74,11 @@ func NewAvsWriterFromConfig(baseConfig *config.BaseConfig, ecdsaConfig *config.E | |||
func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMerkleRoot [32]byte, senderAddress [20]byte, nonSignerStakesAndSignature servicemanager.IBLSSignatureCheckerNonSignerStakesAndSignature) (*types.Receipt, error) { | |||
txOpts := *w.Signer.GetTxOpts() | |||
txOpts.NoSend = true // simulate the transaction | |||
tx, err := w.AvsContractBindings.ServiceManager.RespondToTaskV2(&txOpts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature) | |||
tx, err := w.AvsContractBindings.ServiceManager.RespondToTaskV2(&txOpts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature, new(big.Int).SetUint64(5)) |
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 you modify the contract, make sure you pass a larger number so that this transaction does not revert.
|
||
if err != nil { | ||
// Retry with fallback | ||
tx, err = w.AvsContractBindings.ServiceManagerFallback.RespondToTaskV2(&txOpts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature) | ||
tx, err = w.AvsContractBindings.ServiceManagerFallback.RespondToTaskV2(&txOpts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature, new(big.Int).SetUint64(5)) |
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.
Ditto
…p-the-fee-v2' into test-aggregator-bump-fee
…p-the-fee-v2' into test-aggregator-bump-fee
…p-the-fee-v2' into test-aggregator-bump-fee
…p-the-fee-v2' into test-aggregator-bump-fee
…p-the-fee-v2' into test-aggregator-bump-fee
…p-the-fee-v2' into test-aggregator-bump-fee
…p-the-fee-v2' into test-aggregator-bump-fee
…p-the-fee-v2' into test-aggregator-bump-fee
Test aggregator bump fee
Description
This pr is to test #1286. The
respondToTaskV2
function inAlignedServiceManagerContract
has been modified to successfully respond if anith
higher or equal to4
is provided, this is to avoid reverts in next iterations.Then, the context timeout is modified to
1sec
. This way, the context will be done faster than the blockWaitForTransactionReceipt
so a new iteration will start and a new tx will be sent with a highergasPrice
.Testing
To test it, just setup a local devnet as usual and sends proofs of any type.
You should see in the logs how the gas price is increased after every iteration:
Note: you might get
NonceToLow
, that is a matter of timing, since the timer for waiting for a receipt is changed to be 1 second, maybe a transaction gets accepted and when sending again, it can't replace it since it has been accepted. To lower the probability of that, block time was modified to15s
.Finally, you should also be able to see the metrics in the aggregator section:
Type of change
Checklist