diff --git a/core/core.go b/core/core.go index 8d98b424d..6e37cfc5a 100644 --- a/core/core.go +++ b/core/core.go @@ -1306,7 +1306,7 @@ func (c *Core) GetUTXOsByAddress(address common.Address) ([]*types.UtxoEntry, er for _, outpoint := range outpointsForAddress { entry := rawdb.GetUTXO(c.sl.sliceDb, outpoint.TxHash, outpoint.Index) if entry == nil { - return nil, errors.New("failed to get UTXO for address") + continue } utxos = append(utxos, entry) } diff --git a/core/state_transition.go b/core/state_transition.go index cb104e3b3..b817e28d2 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -261,7 +261,7 @@ func (st *StateTransition) preCheck() error { } // Make sure that transaction gasPrice is greater than the baseFee // Skip the checks if gas fields are zero and baseFee was explicitly disabled (eth_call) - if !st.evm.Config.NoBaseFee || st.gasPrice.BitLen() > 0 || st.gasPrice.BitLen() > 0 { + if !st.evm.Config.NoBaseFee || st.gasPrice.BitLen() > 0 || st.minerTip.BitLen() > 0 { if l := st.gasPrice.BitLen(); l > 256 { return fmt.Errorf("%w: address %v, gasPrice bit length: %d", ErrFeeCapVeryHigh, st.msg.From().Hex(), l) diff --git a/internal/quaiapi/api.go b/internal/quaiapi/api.go index 0ed938d42..e015a9200 100644 --- a/internal/quaiapi/api.go +++ b/internal/quaiapi/api.go @@ -704,14 +704,14 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr hi = uint64(*args.Gas) } else { // Retrieve the block to act as the gas ceiling - block, err := b.BlockByNumberOrHash(ctx, blockNrOrHash) + header, err := b.HeaderByNumberOrHash(ctx, blockNrOrHash) if err != nil { return 0, err } - if block == nil { + if header == nil { return 0, errors.New("block not found") } - hi = block.GasLimit() + hi = header.GasLimit() if hi == 0 { hi = params.GasCeil } diff --git a/internal/quaiapi/quai_api.go b/internal/quaiapi/quai_api.go index 81855594f..6cf31b586 100644 --- a/internal/quaiapi/quai_api.go +++ b/internal/quaiapi/quai_api.go @@ -820,7 +820,7 @@ func (s *PublicBlockChainQuaiAPI) EstimateGas(ctx context.Context, args Transact bNrOrHash = *blockNrOrHash } - if args.from(s.b.NodeLocation()).IsInQuaiLedgerScope() && args.To.IsInQiLedgerScope() { + if args.from(s.b.NodeLocation()).IsInQuaiLedgerScope() && args.To != nil && args.To.IsInQiLedgerScope() { // Conversion transaction var header *types.WorkObject var err error diff --git a/internal/quaiapi/transaction_args.go b/internal/quaiapi/transaction_args.go index b2e61a9fe..1ee57a13c 100644 --- a/internal/quaiapi/transaction_args.go +++ b/internal/quaiapi/transaction_args.go @@ -169,10 +169,7 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int, no minerTip *big.Int ) // User specified max fee (or none), use those - gasPrice = new(big.Int) - if args.GasPrice != nil { - gasPrice = args.GasPrice.ToInt() - } + gasPrice = new(big.Int).Set(common.Big0) minerTip = gasPrice value := new(big.Int) if args.Value != nil { @@ -183,6 +180,7 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int, no if args.AccessList != nil { accessList = *args.AccessList } + msg := types.NewMessage(addr, args.To, uint64(*args.Nonce), value, gas, gasPrice, minerTip, data, accessList, false) return msg, nil }