mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
remove expectedRevenue
This commit is contained in:
parent
28a79ec98d
commit
19fc05d6c3
3 changed files with 12 additions and 17 deletions
|
|
@ -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
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue