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

feat: add support for 'finalized' revision in accounts #689

Merged
merged 22 commits into from
May 14, 2024

Conversation

darrenvechain
Copy link
Member

@darrenvechain darrenvechain commented Apr 2, 2024

Description

This PR allows clients to specify finalized as a revision on the accounts endpoints.

The solo instance is also modified to return the best block as the finalized block

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

curl --request GET \
  --url 'https://mainnet.blue.dev.node.vechain.org/accounts/0x3504c0089Ce44d5709BB97a957EC40C76F18dCdA?revision=best' \
  --header 'Accept: application/json, text/plain'
  
  
curl --request GET \
  --url 'https://mainnet.blue.dev.node.vechain.org/accounts/0x3504c0089Ce44d5709BB97a957EC40C76F18dCdA?revision=finalized' \
  --header 'Accept: application/json, text/plain'

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing E2E tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have not added any vulnerable dependencies to my code

@darrenvechain darrenvechain requested a review from a team as a code owner April 2, 2024 11:47
@darrenvechain darrenvechain marked this pull request as draft April 2, 2024 11:47
@codecov-commenter
Copy link

codecov-commenter commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 61.64%. Comparing base (0489d6a) to head (7d7f067).
Report is 3 commits behind head on master.

Files Patch % Lines
api/api.go 0.00% 2 Missing ⚠️
api/utils/revisions.go 93.93% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #689      +/-   ##
==========================================
+ Coverage   61.37%   61.64%   +0.26%     
==========================================
  Files         194      195       +1     
  Lines       18223    18246      +23     
==========================================
+ Hits        11184    11247      +63     
+ Misses       5958     5904      -54     
- Partials     1081     1095      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@darrenvechain darrenvechain marked this pull request as ready for review April 23, 2024 10:07
@nwbrettski
Copy link
Contributor

nwbrettski commented Apr 25, 2024

Add finalized to:

  • transactions endpoint
  • debug trace call endpoint

Add documentation clarifying what finalized means:

  • 360 blocks
  • 2 rounds of BFT

cmd/thor/solo/types.go Outdated Show resolved Hide resolved
@darrenvechain darrenvechain marked this pull request as draft April 25, 2024 13:08
@libotony
Copy link
Member

Add finalized to:

  • transactions endpoint
  • debug trace call endpoint

Add documentation clarifying what finalized means:

  • 360 blocks
  • 2 rounds of BFT

Had a discussion with @darrenvechain, transaction's endpoint does not need finalized, it used to only accept blockID or null

@libotony
Copy link
Member

libotony commented Apr 26, 2024

Do not forget to sync the version thor.yaml with cmd/thor/VERSION @darrenvechain since we got changes in the API spec

@darrenvechain darrenvechain marked this pull request as ready for review May 2, 2024 11:12
api/debug/debug.go Outdated Show resolved Hide resolved
api/debug/debug.go Outdated Show resolved Hide resolved
@darrenvechain darrenvechain merged commit de6037f into vechain:master May 14, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants