Skip to content
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

Add Resource Unit Price Query APIs for Solidity & PBFT #5437

Closed
lxcmyf opened this issue Aug 21, 2023 · 3 comments · Fixed by #5451
Closed

Add Resource Unit Price Query APIs for Solidity & PBFT #5437

lxcmyf opened this issue Aug 21, 2023 · 3 comments · Fixed by #5451
Assignees

Comments

@lxcmyf
Copy link
Contributor

lxcmyf commented Aug 21, 2023

Rationale

The SolidityNode and PBFTNode have slightly different uses in java-tron:

  1. Solidity node
  • Used to synchronize irrevocable solidified blocks
  • Provide solidified block query interfaces
  • Reduce the storage pressure of full nodes
  1. PBFT node
  • Form the PBFT consensus network to generate new blocks
  • Perform trusted block confirmation based on PBFT algorithm
  • Ensure consensus efficiency and security

In short:
The SolidityNode focuses on synchronizing and querying solidified blocks. It can reduce the storage pressure on full nodes and avoid repeatedly synchronizing solidified blocks.
The PBFTNode is used to expand the consensus algorithm. The PBFT algorithm can improve consensus efficiency and reliability.
So their focuses are different:
The SolidityNode focuses on solidified block synchronization, and the PBFTNode focuses on consensus efficiency.
In the latest versions, the SolidityNode has been replaced by the full node. But PBFTNode provide an optional consensus mechanism through dynamic switching of consensus algorithms.

In the TRON network, some interfaces are common across various nodes, and they are not only applicable to FullNode, but also to SolidityNode and PBFTNode. For example, GetEnergyPrices and GetBandwidthPrices are interfaces for querying historical unit prices of bandwidth and energy. However, in recent usage, it has been found that GetBandwidthPrices do not have API implementations for solidity and PBFT. However, GetEnergyPrices do exist, and bandwidth and energy are frequently used resources in the tron network. Their behavior as interfaces for querying should be consistent. Therefore, We hope to supplement the solidity and PBFT implementation of GetBandwidthPrices in future version updates.

Implementation

Add the implementation of solidity and PBFT for GetBandwidthPrices.

@lxcmyf lxcmyf changed the title GetEnergyPrices lacks APIs for solidity and PBFT Add Resource Price Query APIs for Solidity & PBFT Aug 21, 2023
@lxcmyf lxcmyf changed the title Add Resource Price Query APIs for Solidity & PBFT Add Resource Unit Price Query APIs for Solidity & PBFT Aug 21, 2023
@halibobo1205
Copy link
Contributor

great!

@jwrct
Copy link
Contributor

jwrct commented Aug 23, 2023

Looking forward to the implementation of this feature.

@lxcmyf
Copy link
Contributor Author

lxcmyf commented Aug 24, 2023

Next, I will implement it by submitting a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants