mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
Replace big.Int with uint256.Int #582
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#582
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roman-khimov on GitHub (Dec 1, 2020).
There is a promising library that we could reuse for our integer types (both in VM and native contracts): https://github.com/holiman/uint256. We need to try it out, benchmark and compare with our current implementation.
@roman-khimov commented on GitHub (Dec 15, 2022):
For the first iteration we need to try keeping public RPC interfaces with
*big.Inttypes, but useuint256in the VM, full compatibility is important here. Then benchmark it with VM tests we have (Bench*) and neo-bench (of course unit tests must work too). Then we'll see if it's worth it, if yes, we can gradually expand usage of this type in other places.@ZhangTao1596 commented on GitHub (Feb 16, 2023):
You mean we use
uint256inside evm butbig.Intin arguments of evm public methods?What about
util.Uint256?@roman-khimov commented on GitHub (Feb 16, 2023):
util.Uint256is just a fancy way to represent "big" (compared to Uint160) hash. See neo-project/neo#938 also. For numbers that are real numbers (in that they're used for some arithmetic operations) we use*big.Intnow mostly.uint256library is supposed to be faster, but many of our interfaces rely onbig.Intand we can't just throw it away, hence the requirement to keep these interfaces for now, exploring howuint256can help us at the same time (there are some benchmarks in thevmcode).