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

Improve noProof oracle endpoint and fast-failure of proof endpoint #1073

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

area
Copy link
Member

@area area commented Jul 25, 2022

When I made the noProof endpoint, I removed the logic around building the tree, as it wasn't needed. But I could have also removed the bit where it loads all reputations in the state from the database! So I've done that. Similarly, the proof endpoint will now not load all reputations just to check if the requested reputation does not exist.

@area area marked this pull request as ready for review July 25, 2022 11:35
@arrenv
Copy link
Member

arrenv commented Jul 25, 2022

Nice one, this should clean up the browser console a little :)

kronosapiens
kronosapiens previously approved these changes Jul 25, 2022
@@ -901,8 +902,8 @@ class ReputationMiner {

// Not in the accepted or next tree, so let's look at the DB

const allReputations = await this.queries.getAllReputationsInHash.all(rootHash);
if (allReputations.length === 0) {
const res = await this.queries.getReputationHashCount.get(rootHash);
Copy link
Member

Choose a reason for hiding this comment

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

Efficient!

@kronosapiens kronosapiens merged commit ebd8252 into develop Jul 25, 2022
@kronosapiens kronosapiens deleted the maint/oracle-performance-2 branch July 25, 2022 21:36
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.

3 participants