Right now we are on mainnet-1.1.0
Using the history plugin, actions returned by get_actions have block_time included. We are starting to use mongo plugin and have noticed that there is no block_time property included in the action object returned from the actions collection. Right now the only way we've been able to determine block_time is by:
Is there a reason why block_time is not included in the action object returned from actions collection? I understand that the mongo id for that action has an embedded timestamp, but that is pretty much useless that record was inserted at the same time it was created.
Any help much appreciated!
The blcok collection have these infos of transactions、actions、timestamp
@TamirTian Thanks for the response! So we understand that we can get that from blocks collection, but that makes it a lot more difficult to get to. Is there are a reason why there simply isn't block_time on the action object just like from the history plugin? It seems to me like vital piece of info for a transaction.
To answer technically, it is not there because action_traces (replaces actions in the latest 1.2 release) simply serializes an action_trace which does not include that information. We can consider adding it to action_trace. What is your use case?
@heifner Thanks for the response! We currently have a wallet app (EOS Lynx) that utilizes the history_plugin. When Im using get_actions from there, I can easily get the date from the action by block_time. We are starting to move over to mongodb plugin, and currently we have to do a bunch of joins just to simply get the block_time. It would be optimal for us (and other people I’m sure) if block_time was right on the action object.
What do you use the block_time for?
We use it as a reasonably accurate timestamp of the action when listing the action in the wallet.
Ah, ok. thanks for the input.
What’s the likelihood of getting block_time added and where can I follow the progress of it? 🙂
Perhaps a timestamp on both transaction_trace and action_trace would be useful
@flux627 @ismyhc @dskvr
The likelihood is good. Thinking of adding the following to action_trace:
Also updating block_state with irreversible=true.
Also looking at adding block_id to action_trace, but that might come in under a diff pull request.
Awesome!! Looking forward to the commit! :)
Resolved by #5339.
Most helpful comment
Perhaps a
timestampon bothtransaction_traceandaction_tracewould be useful