-
Notifications
You must be signed in to change notification settings - Fork 460
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
Added exchageRate, quaiToQi and qiToQuai in header #2166
Conversation
|
||
ExchangeRate = big.NewInt(1000000000000000) // This is the initial exchange rate in Qi per Quai in Its/Qit | ||
// These numbers should be "equivalent" to the initial conversion rate | ||
QuaiToQiConversionBase = big.NewInt(10000000) // Is the starting "historical conversion" in Qits for 10,000 Quai we need 10,000*1e3 |
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.
Comment references units of Qits but this is QuaiToQi
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.
Just ignoring this as, this is still to be worked on, @kiltsonfire will fix it during the addition of new feature
@@ -1264,6 +1264,44 @@ func (w *worker) prepareWork(genParams *generateParams, wo *types.WorkObject) (* | |||
newWo.Header().SetInterlinkRootHash(interlinkRootHash) | |||
} | |||
|
|||
// Calculate the new Qi/Quai exchange rate |
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.
I don't think you calculated the new rate here. Is this a todo?
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.
Yes, its todo
@@ -114,6 +114,9 @@ type Header struct { | |||
extra []byte `json:"extraData" gencodec:"required"` | |||
stateLimit uint64 `json:"stateLimit" gencodec:"required"` | |||
stateUsed uint64 `json:"stateUsed" gencodec:"required"` | |||
exchangeRate *big.Int `json:"exchangeRate" gencodec:"required"` | |||
quaiToQi *big.Int `json:"quaiToQi" gencodec:"required"` |
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.
Why do you put both of these in the header? won't they always be the inverse of each other?
// protoc-gen-go v1.34.2 | ||
// protoc v5.28.2 | ||
// protoc-gen-go v1.27.1 | ||
// protoc v3.12.4 |
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.
Please update the protoc version, this is two major releases behind and changes the content.
// protoc-gen-go v1.34.2 | ||
// protoc v5.28.2 | ||
// protoc-gen-go v1.27.1 | ||
// protoc v3.12.4 |
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.
Same proto comment
@@ -898,6 +898,7 @@ func (sl *Slice) combinePendingHeader(header *types.WorkObject, slPendingHeader | |||
combinedPendingHeader.Header().SetExpansionNumber(header.ExpansionNumber()) | |||
combinedPendingHeader.Header().SetEtxEligibleSlices(header.EtxEligibleSlices()) | |||
combinedPendingHeader.Header().SetInterlinkRootHash(header.InterlinkRootHash()) | |||
combinedPendingHeader.Header().SetExchangeRate(header.ExchangeRate()) |
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.
If we do need quaitoqi and qitoquai they should be here as well.
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.
Yeah, we need the other two
// protoc-gen-go v1.34.2 | ||
// protoc v5.28.2 | ||
// protoc-gen-go v1.27.1 | ||
// protoc v3.12.4 |
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.
Same proto comment
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.
done
} | ||
} | ||
newWo.Header().SetQiToQuai(qiToQuai) | ||
newWo.Header().SetQuaiToQi(quaiToQi) |
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.
ExchangeRate is missing here
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.
added
@@ -114,6 +114,9 @@ type Header struct { | |||
extra []byte `json:"extraData" gencodec:"required"` | |||
stateLimit uint64 `json:"stateLimit" gencodec:"required"` | |||
stateUsed uint64 `json:"stateUsed" gencodec:"required"` | |||
exchangeRate *big.Int `json:"exchangeRate" gencodec:"required"` |
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.
How is exchangeRate
different from quaiToQi
(or maybe its qiToQuai
)?
closing this PR in favor of this #2174 |
No description provided.