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

Added revision next for optimizing call/estimate related endpoints #776

Merged
merged 20 commits into from
Jul 11, 2024

Conversation

darrenvechain
Copy link
Member

@darrenvechain darrenvechain commented Jun 19, 2024

Description

using the best block + 1 when estimating

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

  • - Added API unit tests
  • - PR is open in the e2e repo, must be merged and then the commit SHA should be updated here

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 June 19, 2024 15:44
api/doc/thor.yaml Outdated Show resolved Hide resolved
@libotony
Copy link
Member

Should be mention that the following parameters will be used during the execution: number, timestamp,total score, gas limit, beneficiary and signer, due to the implementation solution, signer will be zero address

Co-authored-by: libotony <liboliqi@gmail.com>
@darrenvechain
Copy link
Member Author

beneficiary

You mean something like this @libotony ?

image

@libotony
Copy link
Member

beneficiary

You mean something like this @libotony ?

image

Was just spreading the info to the team, but this one looks good!

Copy link
Member

@otherview otherview left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor bits that were mostly captured in the offline discussing.

I'm starting to think the next revision should be operational across all of our endpoints, to avoid creating edge cases. It seems to me fair to assume that if someone is requesting the "next" block they know what is that they are receiveing.

With that in mind a superset o GetSummary would probably consolidate the api flows.

api/accounts/accounts.go Show resolved Hide resolved
api/accounts/accounts.go Outdated Show resolved Hide resolved
Co-authored-by: Darren Kelly <107671032+darrenvechain@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 93.68421% with 6 lines in your changes missing coverage. Please review.

Project coverage is 62.66%. Comparing base (bfa83f3) to head (8b559a3).
Report is 1 commits behind head on master.

Files Patch % Lines
api/utils/revisions.go 90.32% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #776      +/-   ##
==========================================
+ Coverage   62.57%   62.66%   +0.09%     
==========================================
  Files         199      199              
  Lines       18153    18196      +43     
==========================================
+ Hits        11359    11403      +44     
+ Misses       5713     5712       -1     
  Partials     1081     1081              

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

@libotony
Copy link
Member

Minor bits that were mostly captured in the offline discussing.

I'm starting to think the next revision should be operational across all of our endpoints, to avoid creating edge cases. It seems to me fair to assume that if someone is requesting the "next" block they know what is that they are receiveing.

With that in mind a superset o GetSummary would probably consolidate the api flows.

There are two parts using revision, Call/Simulate and Get /blocks/{revsion}, next will only apply to the Call/Simulate, the latter won't work with next(I don't see the necessity for returning a mocked next block in get blocks API). The GetSummaryAndState function can be used to simplify the process, but allowNext is essential to control whether the next is supported.

@libotony libotony changed the title Fix gas estimation Added revision next for optimizing call/estimate related endpoints Jul 9, 2024
@libotony libotony changed the title Added revision next for optimizing call/estimate related endpoints Added revision next for optimizing call/estimate related endpoints Jul 9, 2024
api/debug/debug_test.go Outdated Show resolved Hide resolved
otherview
otherview previously approved these changes Jul 10, 2024
* getsummary and getsummaryAndState decoupling

* restart build
@libotony
Copy link
Member

LGTM, two things needs to be checked:

  1. @otherview @darrenvechain please confirm that the description in the api doc is sufficient
  2. @darrenvechain please confirm that we have next test cases in e2e test

@darrenvechain
Copy link
Member Author

darrenvechain commented Jul 11, 2024

@otherview @darrenvechain please confirm that the description in the api doc is sufficient

Let me add a description to the gas estimation endpoints, encouraging clients to use next Done

@darrenvechain please confirm that we have next test cases in e2e test

I'll get the E2E merged now Done - commit sha updated

@otherview
Copy link
Member

@libotony I think this commit might need to be signed 85d11bc

@libotony
Copy link
Member

@libotony I think this commit might need to be signed 85d11bc

Done, @darrenvechain had to sign your last 2 commits

@otherview otherview merged commit 1e3fe35 into master Jul 11, 2024
12 checks passed
@libotony libotony deleted the fix-gas-estimation branch July 23, 2024 09:03
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.

None yet

4 participants