简体   繁体   English

eth.coinbase的eth.sendTransaction进行多次交易并减少eth.coinbase余额

[英]eth.sendTransaction from eth.coinbase makes multiple transactions and decrease the eth.coinbase balance

Im working on a distributed application using Ethereum, the go-ethereum implementation (Geth). 我正在使用以太坊(以太坊实现(Geth))开发分布式应用程序。

On a Digital Ocean droplet (Ubuntu 16.04) i have installed geth. 我在Digital Ocean Droplet(Ubuntu 16.04)上安装了geth。

I have created a structure like this: 我创建了一个这样的结构:

devnet$ tree -L 2
.
├── accounts.txt
├── boot.key
├── genesis.json
├── node1
│   ├── geth
│   ├── keystore
│   └── password.txt

I have: 我有:

  • One bootnode/discovery node 一个引导节点/发现节点
  • One Seal/full node 一个密封/全节点

The seal node is initialized this way: 密封节点通过以下方式初始化:

geth --datadir node1/ init genesis.json

Then the bootnode: 然后启动节点:

devnet$ bootnode -nodekey boot.key -verbosity 9 -addr :30310
INFO [02-07|22:44:09] UDP listener up                          self=enode://3ec4fef2d726c2c01f16f0a0030f15dd5a81e274067af2b2157cafbf76aa79fa9c0be52c6664e80cc5b08162ede53279bd70ee10d024fe86613b0b09e1106c40@[::]:30310

And after the bootnode is listening, i run geth on the node1: 在bootnode监听之后,我在node1上运行geth:

geth --datadir node1/ --syncmode 'full' --port 30311 --rpc --rpcaddr 'localhost' --rpcport 8501 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --bootnodes 'enode://3ec4fef2d726c2c01f16f0a0030f15dd5a81e274067af2b2157cafbf76aa79fa9c0be52c6664e80cc5b08162ede53279bd70ee10d024fe86613b0b09e1106c40@127.0.0.1:30310' --networkid 1515 --gasprice '1' -unlock '0x87366ef81db496edd0ea2055ca605e8686eec1e6' --password node1/password.txt --mine

Note: this are examples, the real ip, bootnode "enode" value and account arent those. 注意:这是示例,实际ip,bootnode“ enode”值和帐户不存在。

On this private ethereum network i have deployed a ERC20 contract, with a basic Transfer function, so, i wanted to invoke that function from Metamask, using some random address. 在这个专用的以太坊网络上,我已经部署了带有基本Transfer功能的ERC20合约,因此,我想使用一些随机地址从Metamask调用该功能。

For that, i needed to get some ETH in my account, so i have connected to the geth console and transfer some ether from the eth.coinbase to that addres: 为此,我需要在我的帐户中获取一些以太币,因此我已连接到geth控制台,并将一些以太币从eth.coinbase转移到该地址:

eth.sendTransaction({from:eth.coinbase, to:"0xf17f52151ebef6c7334fad080c5704d77216b732", value: web3.toWei(10, "ether")})

After that, I discovered that some transactions that I had no way to identify, i mean, it was only a transaction to send ether from one account to another, why that result in multiple transactions submitted? 之后,我发现我无法识别某些交易,我的意思是,这只是将以太币从一个帐户发送到另一个帐户的交易,为什么会导致提交多个交易?

Here is a screenshot of the situation: 这是情况的屏幕截图:

在此处输入图片说明

Also, every one of those transactions is decreasing the eth.coinbase balance (eth.coinbase == the address that deploys the contract), so i started with a huge amount of Ether on that account and after some of those "ghost" transactions the balance of eth.coinbase was like 0.0026 Ether.. 此外,每笔交易都在减少eth.coinbase余额(eth.coinbase ==部署合同的地址),因此我从该帐户上以大量的以太币入手,然后进行了一些“幽灵”交易eth.coinbase的余额类似于0.0026以太..

So, i have 2 questions 所以,我有2个问题

  1. Is there any scenario that could decrease the contract owner address/coinbase balance? 是否有任何情况可能会减少合同所有者的地址/ Coinbase余额?
  2. Any ideas of why those transactions appear? 关于这些交易为何出现的任何想法?

EDIT: 编辑:

This is the problem ... https://github.com/ethereum/go-ethereum/issues/16691 这是问题... https://github.com/ethereum/go-ethereum/issues/16691

[cross-posting here from Ethereum.SE for completeness] [为了完整起见,在此处以太坊(Ethereum.SE)交叉发布]

Digital Ocean does not block any ports by default, to my knowledge. 据我所知,Digital Ocean默认情况下不会阻止任何端口。

In all probability, your node's RPC is publicly accessible, and when you unlock the account to send your transaction, a bot tries to sweep the rest to its own address (potentially more than one, since there seem to be multiple recipients). 您的节点的RPC很可能是可公开访问的,并且当您解锁帐户以发送交易时,漫游器会尝试将其余的扫描到其自己的地址(可能有多个,因为似乎有多个收件人)。

Try blocking access to the RPC ports from outside the machine using ufw, or simply turn off RPC, since the console works over IPC. 尝试使用ufw阻止从计算机外部访问RPC端口,或者直接关闭RPC,因为控制台可以在IPC上运行。

Indeed, if you look at 0x6e4cc3e76765bdc711cc7b5cbfc5bbfe473b192e and 0x7097f41f1c1847d52407c629d0e0ae0fdd24fd58 on the mainnet, you can see that they have swept close to 15 ETH, and the pending transactions reflect a common tactic of such bots, which is to presign transactions of varying value with higher nonces while the rpc is unlocked. 的确,如果您在 网上查看0x6e4cc3e76765bdc711cc7b5cbfc5bbfe473b192e0x7097f41f1c1847d52407c629d0e0ae0fdd24fd58 ,您会发现它们已接近15 ETH,而待处理的交易反映了这种先发制人的非交易性策略是改变这种先发制人的非常规价值,而待处理的交易则反映了这种情况。 rpc解锁。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM