Skip to content
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

Raise market allowance infinite constant #628

Merged
merged 4 commits into from
Sep 12, 2022

Conversation

ZenGround0
Copy link
Contributor

If I understand the way datacap works with the TokenAmount type it is 1) measured in units of bytes 2) measured at a base level of atto bytes when tokenized. That is a token amount of 10^18 should represent one byte.

If these assumptions are correct then the recent infinite limit is not actually that big ~GBs. This PR changes it to ~1000 EiB. Unfortunately TokenAmount::from_whole takes i64 not i128 so creating this constant is now messy.

@ZenGround0 ZenGround0 requested a review from anorth September 9, 2022 03:50
Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can clean this up after filecoin-project/ref-fvm#862

actors/datacap/src/lib.rs Outdated Show resolved Hide resolved
static ref INFINITE_ALLOWANCE: TokenAmount = TokenAmount::from_whole(2_000_000_000);
static ref INFINITE_ALLOWANCE: TokenAmount = TokenAmount::from_atto(
BigInt::from(1_000_000_000_000_000_000_i64)
* BigInt::from(1_000_000_000_000_000_000_000_i128)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document the 1000EiB intention.

@ZenGround0 ZenGround0 merged commit e528bc8 into decouple-fil+ Sep 12, 2022
@ZenGround0 ZenGround0 deleted the feat/bigger-infinity branch September 12, 2022 17:00
shamb0 pushed a commit to shamb0/builtin-actors that referenced this pull request Jan 31, 2023
* Raise infinite constant
* Remove testing of more complex behavior

Co-authored-by: zenground0 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants