-
Notifications
You must be signed in to change notification settings - Fork 648
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
Change object_id to more than 32 bit #1088
Comments
By the way, |
@ryanRfox I want to claim this issue if possible please |
@cogutvalera thanks for your passion. However, to be honest, this issue is very complicated, I don't think you're ready. |
@abitmore let's see ? I don't think it is impossible for me or too complicated ;-) can I try to fix this issue or not ? |
Of course you can try. But I still think it's better (for you) to get familiar with the code base with smaller issues first. Just my own opinion though. By the way, this issue is now labeled "discussion needed". We need to evaluate it, figure out the scope, the direction, before start coding. |
@abitmore Thanks a lot ! Let's discuss it more before coding :-) 👍 Just want to teach myself faster about core code base by trying to fix more interesting and complicated issues. Let's discuss first of all this issue and we'll see later ... |
@abitmore what is your concern regarding serialization? |
I mean we need to make sure all components will work after the value exceeded 32 bits; IIRC there was an issue about it, from EOS. |
I am just thinking about the serialization issue. To test:
My question is where are the places that use serialization? Persisting to disk and p2p are what come to mind. Any others? I may be able to create a test if everyone thinks it is worthwhile. |
@jmjatlanta the test case in bitshares/bitshares-fc#64 explains. We can make 2 test cases, one for numbers less than 32 bit and the other for numbers greater than 32 bit, both old and new code should pass the former, but only new code will pass the latter. |
I'm just thinking of the un-serialization of a 32-bit value by a peer running old code, where the stream was serialized by a machine running new code. So during the I'm not saying it is broken. I just want to provide a scenario that may not have been tested for. I think the only way to test that is to As I have not gone through the particulars of pack and unpack, I may be thinking of a problem that simply does not exist. |
Technically it's correct, but practically we won't have both the old code and the new code in the code base. So the test cases should be some inputs and expected outputs. Sure we need to test both |
Okay. Thank you for the clarification @abitmore . I assumed we used this serialization for p2p as well. |
Technically this is a consensus-changing issue, but practically we won't hit the edge in the soon future, so I moved it to a feature release. |
Fixed by #1267. |
According to the code,
object_id::instance
isunsigned_int
:bitshares-core/libraries/db/include/graphene/db/object_id.hpp
Line 134 in af118f6
However,
unsigned_int
is actually implemented withuint32_t
in FC (code is here):That means the maximum value is
4,294,967,296
.As of writing, the object with biggest
instance
value in BitShares main net is2.9.239985810
, which is1/18
of the maximum value.The chain is now running at around 1M operations per day, which is around
365,000,000
operations per year, so around 10 years to hit the maximum. If average TPS reached 100, the limitation will be hit in a little more than a year.This is an important issue, but we still have some time to fix it.
Things to be done:
unsigned_int
, changeobject_id
to use that oneunsigned_int
and change to the 64-bit one as wellSince it affects serialization, after fixed in core, client libraries will need to adapt, so we need to at least notify them. Old client libs should be compatible before we reach the 32bit limit. Known client libraries include:
varuint64
and replacevarint32
bitsharesjs#29)By the way,
total_ops
andremoved_ops
inaccount_statistics_object
are 32 bit. Perhaps worth a new issue though.The text was updated successfully, but these errors were encountered: