-
Notifications
You must be signed in to change notification settings - Fork 20.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth_listTransactions #1897
Comments
This is useless - transactions are merely one way of two ways to send a message to an object ("contract") in Ethereum; CALL would be the other way. Use logs. It's what they were designed for. |
would close. |
@gavofyork It's far from useless. For example, it would be very useful for keeping track of non-contract txs, which cannot use logs. This feature has been requested from several people. We shouldn't force users to only use the platform in a certain way, and If users desire a API call which doesn't conflict with anything or have any significant drawbacks, we should consider adding it. I'm in favour of adding this. |
So am I. But let the community decide on this. Get enough +1 and it will eventually be considered/added. |
Maybe messages to non-contract addresses should automatically get a blank log entry? It would store the originating transaction id. |
👍 I fully agree with gustav here. Even though most of the cool stuff can happen in contracts, being able to simply send money from one account to the other will be heavily used. And then you need a easy way to display its transactions (e.g. the wallet needs that for example :) ) I would add a second parameter, which is the |
eth_listTransactions is very much needed for Ether to Ether transactions. For wallet devs we need a way to present this information to users so they know how their Ether was spent and when it was spent and which TX hashes they occurred in. Adding a separate persistence layer to store this data for easy access is cumbersome and would have to be constantly updated on the client side. This is very useful and much needed. |
+1 I found myself looking for this feature.. would be great to get it included. |
👍 |
this is much more efficient IMO than the logs...and there's a lot of use cases for this feature for execution in other contracts. |
I would add a third optional parameter for number of transactions from the top or bottom (perhaps something python-esque?) |
Though i +1 this feature @VoR0220 you can't get logs only from transactions, as there can also be logs created when one contract interacts with another.. So only relying on this feature won't work. I don't like the third parameter actually, as a |
how does nonce control how many transactions you would like to see? |
👍 |
If you say i want to get all transactions from nonce 50 and there a re a total of 60 tx, you will get 10 |
@frozeman, what if you want to retrieve tx [100...150] when there are 10.000+ transactions? |
@frozeman but that's for a nonce in the chain correct? So I would only get the transactions for that block, no (I might be totally off here and feel free to correct me)? However, if I wanted to go and see the past 50 or so transactions for a particular address, how does that nonce benefit me if I want to get specific with the transactions displayed? |
nonce is an ear increasing number of transactions from an account. And then you can subtract whatever number you want to go back and ask for those tx. |
@bas-vk you couldn't :) |
While easy to implement its difficult to do it right. Indexing all transactions would require quite significant storage and most certainly doesn't scale. One way to do this is as how we MIP mapped LOGs and use a similar query mechanism, but this is an expensive and CPU/IO intensive operation because there are far more transactions than there are LOGs. Doing this for LOGs is actually fine since you more or less paid for it where as transactions incurs no additional cost in terms of upfront payment. letting the user decide what to map isn't an option either since it just won't work for light clients. Light clients depend on archive and full nodes for data retrieval and can't make use of this "user setting" option because they don't receive any other data than the data that is explicit requested. I understand this is a much requested feature but understand that it comes at a great, expensive cost and, as I said earlier, difficult to do it right. |
I don't expect dapps requesting this endpoint often, rather only once when a dapp syncs for the first time. It will then keep this information in a local database anyway. And only requests the last x tx. Remote nodes would have to rate limit their requests anyway somehow. |
I second the need for transaction listings. |
It's not about rate limiting either. Please reread |
list of transaction hashes for a given external or contract account. +1 |
+1, with nonce param. |
@obscuren nonce was not my main point, the need for user friendly transaction listings was. To push end user adoption, we definitely need a user-friendly way to show past transactions that happened during a certain time period and with certain counter parties. Furthermore, the transaction fees occurred for a set of transactions must be easily established. |
@m888m mine neither. I understand what everyone has reiterated over and over again but as I've mentioned above in great detail; there are issues with the requested feature. It's not as simple as it seems. |
Indexing of this can be an optional setting when starting up the node. It doesn't have to be a requirement so clients that do not have CPU power can just turn the feature off. Right now most of the web wallets and mist based wallets are forced to use some external persistence mechanism to have this data available to the user so any efforts to save CPU/etc... becomes a zero sum effort and you add an additional TCP/socket round-trip just to get the data from the blocks and then another connection to the persistence layer. Is the cost of doing indexing on the node greater than that? Probably not. |
@karalabe This is a genuine question |
@wildbunny yes, even if your HD blows up. They are stored in the receipts of the blockchain. They are part of the consensus rules. |
That's why it's costing you Gas. |
@obscuren Perfect, thank you |
@wildbunny there is a |
@altsheets As I also enjoy abusing Ethereum as a currency, I started on a quick & dirty impl here: https://github.com/Gustav-Simonsson/go-ethereum/tree/list_transactions It uses sqlite to index txs on both sender and recipient. It's WIP and pretty hacky - have to rewrite it quite a bit before it'll be ready for others to use. Preliminary benchmarks:
All of these metrics can probably be improved a lot, as the current hack is just a first stab and not optimised. TODOs:
|
wow @Gustav-Simonsson you are a star! I gather it is mainly in eth/addr_txs.go ?
Oops. But 12 * 3600 / 1018621 = 0.04241 is not too bad, actually (there is the 42 again! :-) )
Which are the bottlenecks? Could multithreading help? Query 500 blocks at a time? This supersimple question is not time-ordered.
yes, and that is actually one reason why I had refrained from just doing it myself. Fantastic work! Rawr |
These questions need to be more specific before they can be answers: How will Ethereum deal with all security issues plaguing Bitcoin? Permits all sorts of contracts, allows for faster TXs, will utilise eco-friendly validation. It's a trustless system. Not another IOU system. Solves more important issues. A number of solutions, primarily blockchain sharding. Through carefully structured incentives. How can anyone deal with forking? Through the use of POS validation and aforementioned scaling solutions. What security issues? ethereum/go-ethereum#1897
This kind of information is also required for 3rd party auditing, currently ethereum is hard and error-prone to audit, even for basic transfers and coin generation. There is no point in having sophisticated gas and difficulty mechanics if the monetary part is not sound and auditable (not just for isolated accounts, but for all blockchain accounts and transactions). This is also needs to be auditable efficiently and in real-time, so that fool play can be detected and acted upon quickly. While the core ethereum team is out there to build something, and spurious transactions are more likely to be bugs than scams, this cannot be said or assumed for clones and private chains. Since the code is very complex, it is very hard to justify code and consensus can be trusted, even with multiple implementations (actually multiple implementations for a private chain will only make the 3rd party auditing more expensive). In summary, this is not a care-bear world, without standardized auditing (of which tx listing is a key part), things lean more on the trust side than on the trust-less one. |
+1 Does anyone thinks that not knowing when, from who and how much you received is a cool feature? As I understood the only option is to create contract. So I need to pay to receive ether? Really? |
:-) |
I can only reiterate about what has already been said which makes this feature questionable and difficult to implement correct.
Pay to receive ether? Of course not. The sender is paying, not the receiver. The only part that would cost you ether is the deployment of the contract, which costs you something like 0.001 cents, if not less. This can't be an argument not to use contracts. |
Please note that I'm not arguing that this isn't a good/nice/cool/epic feature. I'm arguing that, while seemingly easy to implement at first sight, is actually quite difficult to do correct, if at all. This isn't bitcoin where the only thing you have are value transfers. Our core is much more complicated that a feature like this becomes difficult to implement or impossible to implement correctly at all. |
@obscuren well that explains it then. last paragraph. thanks |
@obscuren, understood. |
just to clarify, this approach #1897 (comment) is futile then? EDIT: and with futile I meant, that what Gustav-Simonsson seems to have implemented already ... would lead to incorrect results? (Because if not, then just make it optional, or ship it as a standalone code/extension - and everyone's happy?). Working, correct code is the best argument possible. But some of the more recent comments since then would only be understandable, if his approach is ... simply wrong. I am confused. And that is why I asked for clarification - not for restating arguments from before his post, or inventing new ones. If there is already a solution in code, to answer the OP's question - then why argue whether such a solution should exist at all, or not? Makes no sense to me. So: Is his approach only slow/mem-hungry - or is it leading to incorrect results? |
@altsheets Concurrent fast sync takes 11 mins on my machine, uses 2.2GB. The proposed solution needed 12h (!!), used 0.6GB extra data. Guess the feasibility ;) On a serious note, a pruned node does not have the data you want. Isn't stored anywhere, so to get it, you need to crunch through and replay the entire Ethereum history, so fast sync is out of the question. Pruning is out of the question. It's not part of the consensus rules, so light clients are out of the question. The only place where this can be implemented generically is for archive nodes, but those will be very rare. Average users won't have the data needed to index such transactions. This is analogous to the real world: if I look at 5 dollars in my wallet, I don't expect the universe to tell me all the people that ever had those banknotes. No do I want a list with all the cash I've spent and received throughout my lifetime. I know how much I have now and I don't care who gave me how much when. Note, this is for cash. Now when I open a bank account and get a credit card, I expect to see all of my transaction history, but I don't get that for free, I pay my yearly maintenance fees to access that data. It's the same with Ethereum: the Ether is a plain account is cash: you know how much you have, you see the currently pending changes, but no history; whereas a contract can act as a bank account, just you get to choose all the rules of it. The more featured you wany, the more you need to pay the bank to get it, or in this case, you need to support the network with tx fees to maintain extra data on your behalf. Just as a closing remark, the same way as it would be awesome to have automatic past tx history for plain accounts, it would be awesome to have tx data for my personal cash expenditure... But it's not something most pepole need, and it's not sometging that bothers you in real life. Simply assume that a plain account is cold hard cash, whereas a contract is a bank account working accordong to your rules. |
Typed it on my phone, sorry for the many typos. |
@altsheets, it really make sense. The problem is that if you have bitcoin background it's kinda hard to implement same features the same way. For example my users have virtual balances and to transfer some amount to balance they use their own bitcoin address. It's easy to track, because each address belongs to some user. In ethereum I don't see same ways. So creating account for each user is not an option. OK. I can create contract that will track transactions. But this way all my users will send ether to same contract address and how to distinguish who is who? Now I need to ask users to provide some additional data. Do I ask them to provide address, so I can track them later or to provide extra data in each transaction? Well if they use some 3rd party service mby they don't know exactly from which address ether will be send or don't have permissions to add extra data in transactions. In bitcoin (or similar altcoin) you just create new address for every event you want to track and check later for address in transactions. Super easy and flexible. |
@altsheets, about implementation. What about this logic. We have array of our account addresses (let's call it |
@altsheets as I said, I'm not arguing the usefulness of the feature I'm arguing the solutions that have either been suggested or created. If you read my response above you'll find the answer as to why this doesn't work, i.e. The results can not be guaranteed, for anything but full nodes. Since full nodes will not be dominating our network in the future makes this feature request extremely difficult if not at all possible to implement correctly (i.e. The results can never be verified). |
Is that a problem? Full node will have some additional API for tracking, makes sense. |
That would mean some dapps won't work with chains that were created with the fast sync option. Mist will be our primary application to serve dapps and mist always uses the fast sync and therefore it will be impossible to support such a feature. This feature won't work with light clients either and I expect light client to eventually dominate the network mostly. I'm not going to make a promise but we could make such a feature available under, say, |
For example an exchange could use this feature if it wants to be a full/archive node indefinitely. |
I do not see why nodes that do not perform full validation are considered in this discussion. Clients that have to trust other nodes will be intrinsically unsafe for services and dapps, and thus unusable, especially if/when full archive nodes are rare and sybil attacks have become easy. Any use case with real world consequences will need accounting and auditing capability, which means full history for a reasonable time frame (at least weeks, years in many cases). This means running full validating nodes (with data that can be trusted through blockchain trustless mechanisms and consensus) or... rely on "trusted" payment processors and web services to run those nodes for you. Just as for other blockchains, even a light client is vastly more resource-intensive than relying on a web service ala blockchain.info or coinbase. And if a light client cannot provide full, validated information, it would be both less practical and less safe. There would be zero incentive in running your own light client if it cannot match the information provided by explorers like ether camp's full transparency. So the problem may not be an easy one to solve, but it is a necessary cost to be paid for a light client to be useful in a wild, hostile world. |
@fairglu all of the current functionality that is supported by web3 (blocks, receipts, logs, etc) can be verified by a light client. We must consider light clients in this discussion because:
Transactions that come from the call The problem is however solvable by using the Ethereum system as intended as I've only pointed out so many times. If you're looking for a simple value transfer network with said functionality your best option is the Bitcoin network. In any case DApps that rely on transaction tracking are very likely doing it wrong and I'm sure there are more than enough people willing to help solve whatever issue it you're having, including myself. You're always welcome to join our gitter to discuss your issue you're having :-) |
Locking this issue but leaving it open. We're considering a suitable implementation for this feature. No ETA. |
This feature has been discussed on gitter in the past and we would like to see this get implemented for accounts and contracts.
Proposal
eth_listTransactions
Returns a list of transaction hashes for a given external or contract account
Parameters
String - the account or contract address
Returns
DATA - A list of transaction hashes
The text was updated successfully, but these errors were encountered: