Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Temporary param update #352

Merged
merged 4 commits into from
May 8, 2020
Merged

Temporary param update #352

merged 4 commits into from
May 8, 2020

Conversation

zixuanzh
Copy link
Collaborator

@zixuanzh zixuanzh commented May 6, 2020

Updating parameters for unincentivized testnet, we expect further updates before testnet incentives and mainnet launch and even after mainnet.

@zixuanzh zixuanzh requested a review from anorth May 6, 2020 19:16
Copy link
Member

@davidad davidad left a comment

Choose a reason for hiding this comment

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

looks good to me


// The duration of a chain epoch.
// This is used for deriving epoch-denominated periods that are more naturally expressed in clock time.
const EpochDurationSeconds = 25
Copy link
Member

Choose a reason for hiding this comment

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

is this the variable we should use instead of BlockTimeSeconds in reward_state.go soon?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe so, will let @anorth confirm

Copy link
Member

Choose a reason for hiding this comment

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

Yes

Copy link
Member

Choose a reason for hiding this comment

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

can we make some of these vars? that way we can change them live in the implementations for testing things.

Copy link
Member

Choose a reason for hiding this comment

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

it would pain me, but in lieu of taking time to make them properly configurable, I'm on board.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will let you guys make the change here in a different PR

Copy link
Member

Choose a reason for hiding this comment

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

I tried, but the change must flow on to all the other constants that are derived from this value, which need to read the live-changed value rather than the initial one set here, and thus be functions. I opted not to force this on us so close to testnet-2.

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.

actors/abi/epoch.go Outdated Show resolved Hide resolved

// The duration of a chain epoch.
// This is used for deriving epoch-denominated periods that are more naturally expressed in clock time.
const EpochDurationSeconds = 25
Copy link
Member

Choose a reason for hiding this comment

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

Yes

actors/abi/epoch.go Outdated Show resolved Hide resolved
@@ -7,7 +7,7 @@ const DealUpdatesInterval = 100

// Bounds (inclusive) on deal duration
func dealDurationBounds(size abi.PaddedPieceSize) (min abi.ChainEpoch, max abi.ChainEpoch) {
return abi.ChainEpoch(0), abi.ChainEpoch(10000) // PARAM_FINISH
return abi.ChainEpoch(0), abi.ChainEpoch(abi.SecondsInYear / abi.EpochDurationSeconds) // min 0, max 1y, PARAM_FINISH
Copy link
Member

Choose a reason for hiding this comment

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

Why 1 year? Why is there a max? Why not a millenium? If there's some concrete justification please write it here in a comment, otherwise use a "never going to happen" large number.

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator Author

@zixuanzh zixuanzh May 7, 2020

Choose a reason for hiding this comment

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

we are expecting to upgrade PoRep fairly often anyways. There is no reasons for an arbitrarily long deals and we are looking to add feature to extend deal duration post mainnet. Lastly, maximum deal duration of a year for testnet seems reasonable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's more a question of what the number "means" -- I feel like the only good numbers for placeholders are 0 and infinity (regardless of whether our schedule means something like 1 year is "practically infinity").

Copy link
Member

Choose a reason for hiding this comment

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

It’s not just a placeholder, it’s an assumption we have been making for a while in cryptoecon that we only consider sector lifetimes up to 1 year. After 1 year it may become rational to terminate (probably not, but I‘d want to think about it more if we want to increase this bound).

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I will document that assumption in the code.

Note that this deal bound does not bound sector lifetimes, though.

actors/builtin/miner/policy.go Outdated Show resolved Hide resolved
actors/builtin/reward/reward_actor.go Outdated Show resolved Hide resolved
actors/builtin/reward/reward_state.go Outdated Show resolved Hide resolved
Quantization: SecondsInDay / EpochDurationSeconds, // 1 day, PARAM_FINISH
InitialDelay: abi.ChainEpoch(7 * abi.SecondsInDay / abi.EpochDurationSeconds), // 1 week for testnet, PARAM_FINISH
VestPeriod: abi.ChainEpoch(7 * abi.SecondsInDay / abi.EpochDurationSeconds), // 1 week for testnet, PARAM_FINISH
StepDuration: abi.ChainEpoch(12 * abi.SecondsInHour / abi.EpochDurationSeconds), // 12 hours for testnet, PARAM_FINISH
Copy link
Member

Choose a reason for hiding this comment

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

what happens if EpochDurationSeconds doesnt evenly divide secondsInHour?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it will be truncated which i think it's fine, we will have to add test cases here to make sure

Copy link
Member

Choose a reason for hiding this comment

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

As long as the remainder 12*SecondsInHour % EpochDurationSeconds is less than, say, 1 percent of 12*SecondsInHour, it’s not so bad. But it would be really nice if the epoch duration is a divisor of 3600. There are so many: 1 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 30 36 40 45 48 50 60 72 75 80 90 100...

@zixuanzh
Copy link
Collaborator Author

zixuanzh commented May 7, 2020

@anorth I have set stepDuration to 1 day and quantization to 12 hours. I think a max deal duration of 1 year is reasonable, at least for testnet and even mainnet. Let us know what you think (cc @davidad).

@anorth
Copy link
Member

anorth commented May 8, 2020

I am going to make some cosmetic changes and then approve and land this.

@anorth anorth merged commit 1a6df76 into master May 8, 2020
@anorth anorth deleted the param-update branch May 8, 2020 06:00
aarshkshah1992 pushed a commit that referenced this pull request Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants