Error in Alchemy: Can someone explain why maxFeePerGas must be greater than or equal to maxPriorityFeePerGas?

I've been following a tutorial at . The twist is that I'm attempting to send ETH to the Ropsten test faucet.

async function main() {
  require('dotenv').config();
  const { API_URL, PRIVATE_KEY } = process.env;
  const { createAlchemyWeb3 } = require('@alch/alchemy-web3');
  const web3 = createAlchemyWeb3(API_URL);
  const myAddress = 'xxxx'; //TODO: replace this address with your own public address

  const nonce = await web3.eth.getTransactionCount(myAddress, 'latest'); // nonce starts counting from 0
  console.log(nonce);
  const transaction = {
    to: '0x9f1099b301716892d17d576387027cE5B73E2c20', 
    value: 100,
    gas: 30000,
    maxFeePerGas: 1000000108,
    nonce: nonce,
    
  };

  const signedTx = await web3.eth.accounts.signTransaction(
    transaction,
    PRIVATE_KEY
  );

  web3.eth.sendSignedTransaction(
    signedTx.rawTransaction,
    function (error, hash) {
      if (!error) {
        console.log(
          '🎉 The hash of your transaction is: ',
          hash,
          "\n Check Alchemy's Mempool to view the status of your transaction!"
        );
      } else {
        console.log(
          'âť—Something went wrong while submitting your transaction:',
          error
        );
      }
    }
  );
}

main();

When running the code, I encounter this error ->

Error: maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two) (tx type=2 hash=not available (unsigned) nonce=23 value=100 signed=false hf=london maxFeePerGas=1000000108 maxPriorityFeePerGas=2500000000)

Update : replacing maxFeePerGas with maxPriorityFeePerGas resolves the issue.

What fundamental concept am I overlooking here?

Answer â„–1

There has been a recent update where the default value of maxPriorityFeePerGas has been increased from 1.0 gwei to 2.5 gwei. This change was made in response to an incentive mechanism for miners.

To learn more about this update, you can visit this link.

If we do not specify the maxPriorityFeePerGas parameter, the default value of 2.5 gwei will exceed the set value of

1.0 gwei</code for <code>maxFeePerGas
, thereby violating the rule.

This issue can be addressed by adjusting either the maxPriorityFeePerGas to be less than

1.0 gwei</code or increasing the <code>maxFeePerGas
to be greater than 2.5 gwei.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can I prevent the content from being pushed when the sidebar is opened in JavaScript and CSS? I want to make it independent

I'm struggling with making the sidebar independent of the main content when it's opened. I've included the CSS and JavaScript code below. Can someone provide assistance with this? function ExpandDrawer() { const drawerContent = docu ...

An issue arises with ReactJS MaterialUI Stepper when there is an overflow

My struggle with the Material UI Stepper component persists as I attempt to make it suit my requirements, specifically to display multiple steps and handle overflow. However, it stubbornly continues to misbehave by showing unusual separators when there is ...

What is the process for sending JavaScript with an Ajax request?

Working with ajax and javascript for the first time, I'm no expert in web development. Here is the code I've written and tested so far. I have a select div containing some options. <select id="month" onchange="refreshGraph()"> When an op ...

Problem encountered while storing data in mongoose database

Within my users route. const User = require('../models/user'); router.route('/verify') .get( (req, res) => { res.render('verify'); }) .post( (req, res, next) => { const {secretToken} = req.body; ...

Does Ext js have a monochromatic theme of blue running through everything

While the blue color may give off a nice office ambiance, it's important to have variety in the appearance of different applications. Is it simple to customize the look in ext js? ...

Spirit.py navigates using javascript

Having trouble with Ghost.py. The website I'm trying to crawl uses javascript for paginated links instead of direct hrefs. When I click on the links, selectors are the same on each page so Ghost doesn't wait since the selector is already present. ...

Javascript canvas producing a laser beam that serves no purpose

Greetings! I am diving into JavaScript and trying my hand at creating a game. The concept is simple - a ship shooting lasers at alien spacecrafts. However, I've encountered a problem with the destroy function that has left me scratching my head. Surpr ...

Retrieve the user-inputted data from an Electron BrowserView's input field

Consider this scenario where a BrowserWindow is set up with specific security settings, including enabling the webviewTag: true for project requirements. let webPrefs = { plugins: false, nodeIntegration: false, nodeIntegrationInWorker: false, ...

Quantities with decimal points and units can be either negative or positive

I need a specialized input field that only accepts negative or positive values with decimals, followed by predefined units stored in an array. Examples of accepted values include: var inputValue = "150px"; <---- This could be anything (from the input) ...

What is the main function of .promise() in Nodejs Lambda functions?

What exactly does .promise() do within AWS Lambda? I am looking to trigger a signal right after a file has been stored in S3. Can someone explain the function of .promise() in this context? (e.g. --s3.putObject({}).promise()--) I noticed that the timesta ...

Display a Three-js Scene in an HTML5 Canvas

Having some trouble rendering a Three-js scene in a canvas on my index page. I've got the basic templates set up for both the canvas and the three-js scene, but how do I actually render the scene on the canvas? index.html <!DOCTYPE html> <h ...

Proper technique for utilizing loadImage in p5.js?

I've been working on loading image URLs from a json file and everything seems to be functioning correctly, except for the actual images not displaying. Currently, I have a simple click carousel set up where clicking moves the index to the next image. ...

Attempting to automatically change the selected input radio button every 3 seconds using HTML

Hey there, I'm just starting out with coding and StackOverflow. I'm attempting to create a basic slider but for some reason, the images are not changing. My goal is to cycle through checked input radio buttons every 3 seconds, but something seems ...

How can it be that "Function" actually functions as a function?

In JavaScript, there exists a function called "Function". When you create an instance of this function, it returns another function: var myfunc = new Function('arg1','arg2','return arg1+arg2'); In the above example, the vari ...

Passing data to an Angular directive

I am facing an issue while trying to pass information through a view in a directive. Despite binding the scope, I keep seeing the string value 'site._id' instead of the actual value. Below is the code for the directive: angular.module('app ...

Ways to control the number of function invocations in an AngularJS controller

I am facing a challenge where data is being fetched from multiple controllers, causing functions to hit the server more than fifty times until they receive a response. I am unsure how to handle this situation effectively and would appreciate some guidance. ...

Antialiasing with Three.js appears to be malfunctioning specifically on iPhone 5 and iPhone 5s devices

As a newbie to three.js, I managed to finish my project successfully. To enhance the graphics quality, I decided to enable antialiasing. renderer = new THREE.WebGLRenderer( { antialias: true } ); Unfortunately, after enabling antialiasing on iPhone 5 and ...

Here's the step-by-step process: Access the specific item in the object by referencing `obj[i]["name of desired attribute"]

I tried seeking advice and consulting multiple sources but none provided a suitable answer. Is there someone out there who can assist me? obj[i].["name of thing in object"] Here's the array: [ { "name": "DISBOARD#2760" ...

Leveraging AJAX for transferring sessionStorage information within a WordPress website

I am working on a way to extract information from sessionStorage that records a post id when specific location pages are visited. The goal is to utilize AJAX to send this data to a PHP function which will use the post id to display location-specific detail ...

"Despite receiving a successful response from curl, AWS Lambda and API Gateway return a 500 error when accessed from a

I am facing challenges with AWS Lambda and API Gateway. While I can successfully call my API using curl and Postman, I am unable to do so from my browser. It works when: curl --header "Content-Type: application/json" \ --request POST \ ...