-
Notifications
You must be signed in to change notification settings - Fork 375
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
feat: native bigint using math/big.Int #764
Conversation
Without touching go spec to support <<, >> for native bigint, it requires right operand to be uint type. PR will panic if IMHO, converting can be conditionally allowed when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my ignorance, but why don't just stick with the standard way to handle bigints in Go, using "math/big"? |
Thanks for your question. The only required component is the implementation and availability of The proposed extension with |
@r3v4s Could you share how you're doing benchmarks? Unless you have a supercomputer, I still think that the best course of action for Gno would be to have uint256/128 instead of bigint, at least initially, as I think they have fewer memory usage implications than bigint. Do you have examples of applications where you think bigints make sense as compared to a uint256? |
|
0a4c4ca
to
0a4217a
Compare
72ea0a7
to
1b2c4d8
Compare
@r3v4s, please sync the master branch and mix conflicts on your PR. Also, could you consider using @mvertes @thehowl @piux2, I'd appreciate your insights regarding the VM change. For everyone's reference, incorporating new keywords is on our roadmap. Adding new types is a logical step, and we can likely ensure compatibility with Go through transpilation scripts. |
1b2c4d8
to
7d66aea
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #764 +/- ##
==========================================
- Coverage 56.31% 47.20% -9.11%
==========================================
Files 422 371 -51
Lines 65699 61706 -3993
==========================================
- Hits 36999 29129 -7870
- Misses 25818 30190 +4372
+ Partials 2882 2387 -495 ☔ View full report in Codecov by Sentry. |
@moul synced pr branch with latest master, there will be no more conflicts for now. However CI is failing because it precompiles OTH, about using gno/docs/reference/go-gno-compatibility.md Line 198 in a4c7b86
|
Consider using While I support integrating larger integer support, launching without it is an option. Please evaluate the impact of a 64-bit limit. Note that without robust bigint support, running IBC might be more challenging, so I guess the deadline for this feature would probably be IBC. This could open up the possibility for a Gnoswap V2 with IBC, while V1 could handle smaller transactions, perhaps utilizing prefixes like “ugnot” and “gnot.” These could eventually be processed automatically by the chain or you contract when such token paris are identified, offering flexibility. While Onbloc considers my previous suggestion, the core team will review your PR with the aim of either merging it or implementing a comparable solution. |
@moul
Let's say gnoswap v2(or later) will support |
To achieve this, we need to modify the gno precompile to generate a distinct yet valid Go code for this scenario. |
What if you use Once native support compatible with This doesn't imply that this PR is bad or anything; it's just about making this point not a launch constraint for you but a v2/milestone constraint. |
I think it's good point to start (also it might reduce complex for go2gno converting function ) |
Closing for now as we are trialling the uint256 package instead. |
Description
This is separated PR which includes only
bigint
from #676Types that can be converted to bigint
How has this been tested?
bigint_test.gno
Benchmark & Performance
Additional
there is #761 issue about memory allocations