What happens to a transaction after you clicked 'send' in Ethereum network?[Transaction life cycle at the EVM and P2P networking level]?
Ref: What happens when you type in an URL in the browser
So in a web browser, it's kinda easy to reason the life cycle of an HTTP request, how it moves down the network stack, reach the server, get a response and travel back up to my browser and gets rendered as a web page.
var contractAbi = eth.contract(AbiOfContract);
var myContract = contractAbi.at(contractAddress);
// suppose you want to call a function named myFunction of myContract
var getData = myContract.myFunction.getData(function parameters);
//finally paas this data parameter to send Transaction
web3.eth.sendTransaction(to:Contractaddress, from:Accountaddress, data: getData);
What happens when I type the following code in a geth console of a 2 node private Ethereum network(1 full pair node, 1 mining node)? Let's say we are running a light client.
- The raw request(JSON RPC) would be sent to 1 of the 2 nodes or broadcast to both of the 2 node at the same time?
- How is the p2p module involved in the whole picture? Just maintain the alist of nodes in the entire 2-node network or just a subset?
- What happens when the raws request reach the first Ethereum node or second? Does it differ (first or sencond)?
- How is EVM work in the picture if I treat it as an blackbox? How the interface look like(input, output)?
EDIT 1: Let's assumming we are using POW. But since there is only one single mining node, POA is fine as well?
EDIT 2: In terms of performing the computation of the transaction(eg. 1+1), how do the mining node(say POA) and normal peer full node differ if they do differ?
EDIT 3: This articledid a great job at explaining on a higher level how a transaction get validated by all the nodes and only get "run" by the mining node, and after being included into the mining node, how a block get broadcasted and its transactions get further validated and propagated until the sender pickup the EVM logs. But how exactly EVM "crunch" the transactions and mutate the state? and how the p2p modules maintain all the nodes?
EDIT 4: this is another nice short read summarizing it as : construct->sign->broadcast->mine
found this cool image here
go-ethereum evm devp2p mastering-ethereum
add a comment |
Ref: What happens when you type in an URL in the browser
So in a web browser, it's kinda easy to reason the life cycle of an HTTP request, how it moves down the network stack, reach the server, get a response and travel back up to my browser and gets rendered as a web page.
var contractAbi = eth.contract(AbiOfContract);
var myContract = contractAbi.at(contractAddress);
// suppose you want to call a function named myFunction of myContract
var getData = myContract.myFunction.getData(function parameters);
//finally paas this data parameter to send Transaction
web3.eth.sendTransaction(to:Contractaddress, from:Accountaddress, data: getData);
What happens when I type the following code in a geth console of a 2 node private Ethereum network(1 full pair node, 1 mining node)? Let's say we are running a light client.
- The raw request(JSON RPC) would be sent to 1 of the 2 nodes or broadcast to both of the 2 node at the same time?
- How is the p2p module involved in the whole picture? Just maintain the alist of nodes in the entire 2-node network or just a subset?
- What happens when the raws request reach the first Ethereum node or second? Does it differ (first or sencond)?
- How is EVM work in the picture if I treat it as an blackbox? How the interface look like(input, output)?
EDIT 1: Let's assumming we are using POW. But since there is only one single mining node, POA is fine as well?
EDIT 2: In terms of performing the computation of the transaction(eg. 1+1), how do the mining node(say POA) and normal peer full node differ if they do differ?
EDIT 3: This articledid a great job at explaining on a higher level how a transaction get validated by all the nodes and only get "run" by the mining node, and after being included into the mining node, how a block get broadcasted and its transactions get further validated and propagated until the sender pickup the EVM logs. But how exactly EVM "crunch" the transactions and mutate the state? and how the p2p modules maintain all the nodes?
EDIT 4: this is another nice short read summarizing it as : construct->sign->broadcast->mine
found this cool image here
go-ethereum evm devp2p mastering-ethereum
add a comment |
Ref: What happens when you type in an URL in the browser
So in a web browser, it's kinda easy to reason the life cycle of an HTTP request, how it moves down the network stack, reach the server, get a response and travel back up to my browser and gets rendered as a web page.
var contractAbi = eth.contract(AbiOfContract);
var myContract = contractAbi.at(contractAddress);
// suppose you want to call a function named myFunction of myContract
var getData = myContract.myFunction.getData(function parameters);
//finally paas this data parameter to send Transaction
web3.eth.sendTransaction(to:Contractaddress, from:Accountaddress, data: getData);
What happens when I type the following code in a geth console of a 2 node private Ethereum network(1 full pair node, 1 mining node)? Let's say we are running a light client.
- The raw request(JSON RPC) would be sent to 1 of the 2 nodes or broadcast to both of the 2 node at the same time?
- How is the p2p module involved in the whole picture? Just maintain the alist of nodes in the entire 2-node network or just a subset?
- What happens when the raws request reach the first Ethereum node or second? Does it differ (first or sencond)?
- How is EVM work in the picture if I treat it as an blackbox? How the interface look like(input, output)?
EDIT 1: Let's assumming we are using POW. But since there is only one single mining node, POA is fine as well?
EDIT 2: In terms of performing the computation of the transaction(eg. 1+1), how do the mining node(say POA) and normal peer full node differ if they do differ?
EDIT 3: This articledid a great job at explaining on a higher level how a transaction get validated by all the nodes and only get "run" by the mining node, and after being included into the mining node, how a block get broadcasted and its transactions get further validated and propagated until the sender pickup the EVM logs. But how exactly EVM "crunch" the transactions and mutate the state? and how the p2p modules maintain all the nodes?
EDIT 4: this is another nice short read summarizing it as : construct->sign->broadcast->mine
found this cool image here
go-ethereum evm devp2p mastering-ethereum
Ref: What happens when you type in an URL in the browser
So in a web browser, it's kinda easy to reason the life cycle of an HTTP request, how it moves down the network stack, reach the server, get a response and travel back up to my browser and gets rendered as a web page.
var contractAbi = eth.contract(AbiOfContract);
var myContract = contractAbi.at(contractAddress);
// suppose you want to call a function named myFunction of myContract
var getData = myContract.myFunction.getData(function parameters);
//finally paas this data parameter to send Transaction
web3.eth.sendTransaction(to:Contractaddress, from:Accountaddress, data: getData);
What happens when I type the following code in a geth console of a 2 node private Ethereum network(1 full pair node, 1 mining node)? Let's say we are running a light client.
- The raw request(JSON RPC) would be sent to 1 of the 2 nodes or broadcast to both of the 2 node at the same time?
- How is the p2p module involved in the whole picture? Just maintain the alist of nodes in the entire 2-node network or just a subset?
- What happens when the raws request reach the first Ethereum node or second? Does it differ (first or sencond)?
- How is EVM work in the picture if I treat it as an blackbox? How the interface look like(input, output)?
EDIT 1: Let's assumming we are using POW. But since there is only one single mining node, POA is fine as well?
EDIT 2: In terms of performing the computation of the transaction(eg. 1+1), how do the mining node(say POA) and normal peer full node differ if they do differ?
EDIT 3: This articledid a great job at explaining on a higher level how a transaction get validated by all the nodes and only get "run" by the mining node, and after being included into the mining node, how a block get broadcasted and its transactions get further validated and propagated until the sender pickup the EVM logs. But how exactly EVM "crunch" the transactions and mutate the state? and how the p2p modules maintain all the nodes?
EDIT 4: this is another nice short read summarizing it as : construct->sign->broadcast->mine
found this cool image here
go-ethereum evm devp2p mastering-ethereum
go-ethereum evm devp2p mastering-ethereum
edited Nov 13 '18 at 9:36
noooooooob
asked Nov 13 '18 at 0:49
noooooooobnoooooooob
1649
1649
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You're missing the mining process. You should really explore it for a better understanding.
Transactions will be sent to one of the nodes which will broadcast the transaction to the other(s). Concurrency and order isn't important because although the transactions will eventually be known to all nodes, none of the nodes will do any transaction processing at this stage.
Someone will mine a block. It could be PoA, POW, something else. It doesn't matter as long as all/both nodes can agree on block validity. Eventually, not simultaneously, all nodes will be made aware of the new block.
Blocks are well-ordered sets of transactions. So, both nodes will eventually agree on a transaction order. By extension, the nodes will agree on the state at each block height.
Transactions are processed in the order they appear in the mined blocks.
Hope it helps.
So how do EVM "run" an transaction and when does it happen? during propagation or only happens when a miner node decides to include a tx into a block?
– noooooooob
Nov 13 '18 at 9:33
Nodes run transactions when they appear in a block.
– Rob Hitchens
Nov 13 '18 at 13:20
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "642"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f62224%2fwhat-happens-to-a-transaction-after-you-clicked-send-in-ethereum-networktran%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're missing the mining process. You should really explore it for a better understanding.
Transactions will be sent to one of the nodes which will broadcast the transaction to the other(s). Concurrency and order isn't important because although the transactions will eventually be known to all nodes, none of the nodes will do any transaction processing at this stage.
Someone will mine a block. It could be PoA, POW, something else. It doesn't matter as long as all/both nodes can agree on block validity. Eventually, not simultaneously, all nodes will be made aware of the new block.
Blocks are well-ordered sets of transactions. So, both nodes will eventually agree on a transaction order. By extension, the nodes will agree on the state at each block height.
Transactions are processed in the order they appear in the mined blocks.
Hope it helps.
So how do EVM "run" an transaction and when does it happen? during propagation or only happens when a miner node decides to include a tx into a block?
– noooooooob
Nov 13 '18 at 9:33
Nodes run transactions when they appear in a block.
– Rob Hitchens
Nov 13 '18 at 13:20
add a comment |
You're missing the mining process. You should really explore it for a better understanding.
Transactions will be sent to one of the nodes which will broadcast the transaction to the other(s). Concurrency and order isn't important because although the transactions will eventually be known to all nodes, none of the nodes will do any transaction processing at this stage.
Someone will mine a block. It could be PoA, POW, something else. It doesn't matter as long as all/both nodes can agree on block validity. Eventually, not simultaneously, all nodes will be made aware of the new block.
Blocks are well-ordered sets of transactions. So, both nodes will eventually agree on a transaction order. By extension, the nodes will agree on the state at each block height.
Transactions are processed in the order they appear in the mined blocks.
Hope it helps.
So how do EVM "run" an transaction and when does it happen? during propagation or only happens when a miner node decides to include a tx into a block?
– noooooooob
Nov 13 '18 at 9:33
Nodes run transactions when they appear in a block.
– Rob Hitchens
Nov 13 '18 at 13:20
add a comment |
You're missing the mining process. You should really explore it for a better understanding.
Transactions will be sent to one of the nodes which will broadcast the transaction to the other(s). Concurrency and order isn't important because although the transactions will eventually be known to all nodes, none of the nodes will do any transaction processing at this stage.
Someone will mine a block. It could be PoA, POW, something else. It doesn't matter as long as all/both nodes can agree on block validity. Eventually, not simultaneously, all nodes will be made aware of the new block.
Blocks are well-ordered sets of transactions. So, both nodes will eventually agree on a transaction order. By extension, the nodes will agree on the state at each block height.
Transactions are processed in the order they appear in the mined blocks.
Hope it helps.
You're missing the mining process. You should really explore it for a better understanding.
Transactions will be sent to one of the nodes which will broadcast the transaction to the other(s). Concurrency and order isn't important because although the transactions will eventually be known to all nodes, none of the nodes will do any transaction processing at this stage.
Someone will mine a block. It could be PoA, POW, something else. It doesn't matter as long as all/both nodes can agree on block validity. Eventually, not simultaneously, all nodes will be made aware of the new block.
Blocks are well-ordered sets of transactions. So, both nodes will eventually agree on a transaction order. By extension, the nodes will agree on the state at each block height.
Transactions are processed in the order they appear in the mined blocks.
Hope it helps.
answered Nov 13 '18 at 1:46
Rob HitchensRob Hitchens
28.8k74482
28.8k74482
So how do EVM "run" an transaction and when does it happen? during propagation or only happens when a miner node decides to include a tx into a block?
– noooooooob
Nov 13 '18 at 9:33
Nodes run transactions when they appear in a block.
– Rob Hitchens
Nov 13 '18 at 13:20
add a comment |
So how do EVM "run" an transaction and when does it happen? during propagation or only happens when a miner node decides to include a tx into a block?
– noooooooob
Nov 13 '18 at 9:33
Nodes run transactions when they appear in a block.
– Rob Hitchens
Nov 13 '18 at 13:20
So how do EVM "run" an transaction and when does it happen? during propagation or only happens when a miner node decides to include a tx into a block?
– noooooooob
Nov 13 '18 at 9:33
So how do EVM "run" an transaction and when does it happen? during propagation or only happens when a miner node decides to include a tx into a block?
– noooooooob
Nov 13 '18 at 9:33
Nodes run transactions when they appear in a block.
– Rob Hitchens
Nov 13 '18 at 13:20
Nodes run transactions when they appear in a block.
– Rob Hitchens
Nov 13 '18 at 13:20
add a comment |
Thanks for contributing an answer to Ethereum Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f62224%2fwhat-happens-to-a-transaction-after-you-clicked-send-in-ethereum-networktran%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown