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 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 { func (pool *Rip7560BundlerPool) selectExternalBundle() *types.ExternallyReceivedBundle {
var selectedBundle *types.ExternallyReceivedBundle if len(pool.pendingBundles) == 0 {
for _, bundle := range pool.pendingBundles { return nil
if selectedBundle == nil || selectedBundle.ExpectedRevenue.Cmp(bundle.ExpectedRevenue) == -1 {
selectedBundle = bundle
} }
} return pool.pendingBundles[0]
return selectedBundle
} }

View file

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

View file

@ -10,7 +10,7 @@ import (
"math/big" "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 { if len(args) == 0 {
return common.Hash{}, errors.New("submitted bundle has zero length") 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{ bundle := &types.ExternallyReceivedBundle{
BundlerId: bundlerId, BundlerId: bundlerId,
ExpectedRevenue: expectedRevenue,
ValidForBlock: creationBlock, ValidForBlock: creationBlock,
Transactions: txs, Transactions: txs,
} }