Giter Club home page Giter Club logo

Comments (9)

ug93tad avatar ug93tad commented on May 31, 2024

the code in the paper is for Hyperledger. it is written in Go.

For Ethereum, the bench_q2.js is correct.

from blockbench.

jshaw29 avatar jshaw29 commented on May 31, 2024

Hi @ug93tad

I was talking about the hyperledger versions of the benchmark

Specifically I was talking about how bench_q2.js calls the QueryAccount function in the go code

image

And here is that function in the go code

image

query account only takes in the account and a block number. Then it returns the account balance at that block

It doesn't seem to actually find the Max Transaction value of an account between blocks i and j. It just gets the balance of an account at block i

from blockbench.

ug93tad avatar ug93tad commented on May 31, 2024

oh i see. There're a mix-up in the implementation of bench_q1.js and bench_q2.js here.

The idea is to use query_account for every block from start_block to end_block, similar to the "get_max" function in bench_q1.js. (In fact, bench_q1.js was supposed to contain the correct implementation for Q2, and vice-versa).

We'll update the code.
@ijingo

from blockbench.

ijingo avatar ijingo commented on May 31, 2024

@ug93tad not a mix-up, it seems a typo.

There is a "range_account" method in analytic.go for this query, which takes in three parameters.

Change the "QueryAccount" (line 18) in bench_q2.js to "RangeAccount" to invoke the correct query.

@Bigboss88 I don't have the test environment now, would you mind trying it?

from blockbench.

jshaw29 avatar jshaw29 commented on May 31, 2024

@ug93tad
@ijingo

Hello I've tried the range_account It still seems to return the max balance of the account which is different than the max transaction value

image
I've added some things to the response to help with debugging. Such as I that tracks how many time through the for loop the program runs

image
It seems to run that same number of time regardless of the start and end block

from blockbench.

ijingo avatar ijingo commented on May 31, 2024

@Bigboss88

Hi, it seems to me the query works. I am not so sure about "return the max balance of the account which is different than the max transaction value" you said.

According to the implementation, the loop will start from the latest version of one account (lines 367 - 370) and stop until the block number is smaller than the input range (line 377), so no matter what end block you input, it will scan start from the latest one. Try some different start block number as the input, it may output different loop numbers.

from blockbench.

jshaw29 avatar jshaw29 commented on May 31, 2024

@ijingo
Ok that makes sense

What I meant was that Q2 is supposed to find the max transaction value of an account between block i and j

Unless I'm wrong in the go code it's comparing the balance of the account versions

if balance.Val > ret && balance.StartBlock >= start_blk && balance.StartBlock <= end_blk {
ret = balance.Val
}

from blockbench.

ijingo avatar ijingo commented on May 31, 2024

@Bigboss88

Oh yes, you are right, this one should be Q3 like q3 in ethereum analytics

Actually Q2 implementation is similar, just to query the difference between versions. Q2 and Q3 are similar which are aimed to demonstrate account level scan query, whereas Q1 is to demonstrate block level scan query.

from blockbench.

jshaw29 avatar jshaw29 commented on May 31, 2024

@ijingo
Ok thanks I'll make those changes

from blockbench.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.