Code Monkey home page Code Monkey logo

Comments (6)

ixje avatar ixje commented on June 26, 2024

I think failure would make sense if the total gas to claim suggested by neo-python is bigger than what the others think, but smaller shouldn't fail. A wrong total value is still an issue of course.

I have to let this one sink in for a moment. I've been working on neo3 for a while now that I have to refresh my mind on the 2.x code base and UTXO model.

from neo-python.

ixje avatar ixje commented on June 26, 2024

I think it will be hard for me to debug anything given that it is a claim on your account. My first idea is to compare the unclaimed returned here

def CalculateBonusIgnoreClaimed(inputs, ignore_claimed=True):

with what the C# client would say here (make sure to not accidentally relay the transaction on the C# side)
https://github.com/neo-project/neo/blob/54d0f29c82fc38b4af7d7d2df05e4e564e7966dd/neo/Persistence/Snapshot.cs#L35

Comparing start height, end height and output value. If there is no difference there, then it must be somewhere here

def CalculateBonusInternal(unclaimed):

from neo-python.

brianlenz avatar brianlenz commented on June 26, 2024

OK, I have tracked the issue down to GetSysFeeAmountByHeight. The end block height for this transaction is 5028923. I checked the expected fee via JSON-RPC, and it's supposed to be 307291. The value being returned by neo-python is 27399.

When I manually run the rest of the GAS calculation with the proper/expected value, it does result in the proper GAS amount, so this is definitely the issue.

I'm going to see if I can get a new chain DB to see if it's just my local DB being out-of-whack that's the issue.

from neo-python.

brianlenz avatar brianlenz commented on June 26, 2024

I checked a different fully sync'd neo-python chain, and it has the same issue.

@ixje, do you have a neo-python 2.0 chain you can test against? I'm just using the RPC server to quickly test:

np-api-server --mainnet --port-rpc 8099

With the JSON-RPC call:

curl -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"getblocksysfee","params":[5028923],"id":1234}' http://localhost:8099

Expecting a value of 307291 but getting a value of 27399.

from neo-python.

ixje avatar ixje commented on June 26, 2024

@ixje, do you have a neo-python 2.0 chain you can test against?

I unfortunately have to say no. I used to have a VPS running the latest version for audit reasons but that seems to have died and I've not been able to recover it (yet). The fastest option I can think of is taking a neo-python bootstrap 4117000 and the latest available chain.acc from NGD and using np-import to sync back up (something like np-import -m -a -i chain.acc --datadir <root folder containing "Chains/Main/">).

iirc the neo-python bootstrap was made with 0.9.1. That should be the fastest route to checking if it's a local chain issue or not.

from neo-python.

brianlenz avatar brianlenz commented on June 26, 2024

It worked! 🎉 I did a full re-sync, starting from @ixje's bootstrap, syncing with chain.acc, and then syncing the last 200k blocks in np-prompt (which took over a week in total 😳). The gas calculations that resulted from the full rebuild were correct and solved the issue.

Thanks, @ixje! Glad to hear neo-python had it right; once I saw your confidence that it should work, I was very hopeful that's all it would be 👍

from neo-python.

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.