Go-ethereum: How to force a transaction to be transferred to the signer nodes right after it is sent to the network?

Created on 29 Jul 2018  路  4Comments  路  Source: ethereum/go-ethereum

Geth version: 1.8.12-stable
OS & Version: Linux/OSX

(https://ethereum.stackexchange.com/questions/55108/how-to-force-a-transaction-to-be-transferred-to-the-signer-nodes-right-after-it)


Expected Behavior

Transactions to distributed to network right at its sent block number and deployed within that.


Actual Behavior

Transactions are delayed one block time to be distributed over network and consequently deployed one block time late.


Explanation

I have a small cluster that is connected to private Ethereum chain that uses POA and block time is fixed 15 seconds. The cluster has four nodes that all nodes are connected to each other. Please note that, there is three signer nodes on my cluster.

When I submit a transaction from a node; the transaction does not reach to all signer nodes on the current block but it is transferred onto the next block. But, I observe that the sent transaction was received by the non-signer node right after it is sent.

For example; when I sent a transaction within the current block, it will not deployed on the current block but on the up coming block. So this forces network to deploy a transaction in 2 block time which is in between 15 seconds to 30 seconds.


Example case:
alper@home is non-signer node and other nodes are signer node.

I sent a transaction within block number 869,334 from node named eBloc@netlab (signer-node) and transaction shows up right after at alper@home named node (non-signer node) on block number 869,334 but it does not show up on the signer nodes even on the node that I sent it from.

enter image description here

On the next block (869,335) I observe that all nodes receive the transactions.

enter image description here

And finally on block number (869,336) the transaction is deployed.

enter image description here

=> If the transaction was distributed to all cluster right after it sent it should be deployed on the block number (869,334) but it used 1 additional block time for this.

[Q1] Why the sent transaction received by the non-signer nodes right after it is sent but not by the signer nodes?

[Q2] Is this normal that the sent transaction won't transfer to all the network right after it is sent but it takes additional 1 block time even all nodes are connected to each other? Is there any way to force to transfer a transaction to all my signer nodes right after it has been sent?

Most helpful comment

The transaction should propagate across the network at the same time.

It however is not included in the current block, because the block currently being mined is already finalized. It's expensive to recreate a new block every time a new transaction pops up. And in the case of mainnet, the blocks are full either way so it doesn't make much sense. This is why there's always 1 block delay between submitting and mining.

For testnets though, we have some code that reworks the miner and among other, we also want to have functionality to immediately include transactions into blocks if there is still space.

All 4 comments

The transaction should propagate across the network at the same time.

It however is not included in the current block, because the block currently being mined is already finalized. It's expensive to recreate a new block every time a new transaction pops up. And in the case of mainnet, the blocks are full either way so it doesn't make much sense. This is why there's always 1 block delay between submitting and mining.

For testnets though, we have some code that reworks the miner and among other, we also want to have functionality to immediately include transactions into blocks if there is still space.

@karalabe Thanks for your valuable response.

As I understand, my example case is a normal case for the mainnet, where signer nodes obtains and signs transactions 1 block delayed, the system forces this. But this implementation also covers testnets.

The functionality to immediately include transactions into blocks if there is still space:

would be very beneficial for those who have a small network like mine. Since I have a small network, there is not much transactions and usually blocks have space, most time they are empty like on my example. I think even immediately including transactions into blocks if its empty would be valuable.


=> What do you mean by reworks the miner and among other?
=> Is there any thread that I can follow the discussion or implementation about this functionality?
=> Is there anything I can do to help and do you know when it would be available for usage for testnets?

We've reworked the miner on the master branch. The current code will regenerate blocks every 3 seconds while mining, so if there are more/better transactions to fir in, the node will chose them.

Thanks!!

I have re-installed geth from its master branch for all the signer nodes. Current version is as follows and it works.

Version: 1.8.15-unstable
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.11
Operating System: linux
GOPATH=
GOROOT=/usr/local/go

Small bug maybe, miners' pending transaction count does not incremented/updated after 3 seconds on the network status GUI (ex: https://ethstats.net) when the transaction sent within the block, but the transaction is deployed. I think network status only updates itself after each block.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdrianScott picture AdrianScott  路  3Comments

carver picture carver  路  3Comments

VoR0220 picture VoR0220  路  3Comments

vogelito picture vogelito  路  3Comments

JMaxU picture JMaxU  路  3Comments