remove expectedRevenue

This commit is contained in:
Dror Tirosh 2024-05-29 13:54:37 +03:00
parent 28a79ec98d
commit 19fc05d6c3
3 changed files with 12 additions and 17 deletions

View file

@ -261,13 +261,10 @@ func (pool *Rip7560BundlerPool) GetRip7560BundleStatus(hash common.Hash) (*types
return pool.includedBundles[hash], nil
}
// Simply returns the bundle with the highest promised revenue by fully trusting the bundler-provided value.
// return first bundle
func (pool *Rip7560BundlerPool) selectExternalBundle() *types.ExternallyReceivedBundle {
var selectedBundle *types.ExternallyReceivedBundle
for _, bundle := range pool.pendingBundles {
if selectedBundle == nil || selectedBundle.ExpectedRevenue.Cmp(bundle.ExpectedRevenue) == -1 {
selectedBundle = bundle
if len(pool.pendingBundles) == 0 {
return nil
}
}
return selectedBundle
return pool.pendingBundles[0]
}

View file

@ -190,7 +190,6 @@ func (tx *Rip7560AccountAbstractionTx) AbiEncode() ([]byte, error) {
type ExternallyReceivedBundle struct {
BundlerId string
BundleHash common.Hash
ExpectedRevenue *big.Int
ValidForBlock *big.Int
Transactions []*Transaction
}

View file

@ -10,7 +10,7 @@ import (
"math/big"
)
func (s *TransactionAPI) SendRip7560TransactionsBundle(ctx context.Context, args []TransactionArgs, creationBlock *big.Int, expectedRevenue *big.Int, bundlerId string) (common.Hash, error) {
func (s *TransactionAPI) SendRip7560TransactionsBundle(ctx context.Context, args []TransactionArgs, creationBlock *big.Int, bundlerId string) (common.Hash, error) {
if len(args) == 0 {
return common.Hash{}, errors.New("submitted bundle has zero length")
}
@ -20,7 +20,6 @@ func (s *TransactionAPI) SendRip7560TransactionsBundle(ctx context.Context, args
}
bundle := &types.ExternallyReceivedBundle{
BundlerId: bundlerId,
ExpectedRevenue: expectedRevenue,
ValidForBlock: creationBlock,
Transactions: txs,
}