-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update core dependencies to v0.70.3 #839
Conversation
39754b8
to
1d7d38e
Compare
unblocked by v0.70.1 point release |
1907382
to
d3eb48e
Compare
@@ -1,6 +1,6 @@ | |||
|
|||
PRAX=lkpmkhpnhknhmibgnmmhdhgdilepfghe | |||
IDB_VERSION=30 | |||
IDB_VERSION=31 |
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.
Needed for the update to unbonding tokens, which now have a different symbol
packages/wasm/crate/Cargo.toml
Outdated
penumbra-stake = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.68.3", package = "penumbra-stake", default-features = false } | ||
penumbra-tct = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.68.3", package = "penumbra-tct" } | ||
penumbra-transaction = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.68.3", package = "penumbra-transaction", default-features = false } | ||
penumbra-asset = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.70.2", package = "penumbra-asset" } |
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 updating v0.68.3
to v0.70.2
on all of these
@@ -273,7 +278,7 @@ export class BlockProcessor implements BlockProcessorInterface { | |||
|
|||
const isLastBlockOfEpoch = !!compactBlock.epochRoot; | |||
if (isLastBlockOfEpoch) { | |||
void this.handleEpochTransition(compactBlock.height, latestKnownBlockHeight); | |||
await this.handleEpochTransition(compactBlock.height, latestKnownBlockHeight); |
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.
Needed to await
due to an unlikely, but possible, race condition. When we save a new epoch to the database during an epoch transition, we look in the database for the previous latest known epoch. We grab its epoch index, increment it by 1, then use that index for the new epoch we're saving to the database.
If that took a long time, for some reason, and in the meantime the block processor had already gotten to the next epoch, we could have two epochs with the same epoch index.
This change makes sure that epoch indexes increment in the correct order.
@@ -75,10 +75,11 @@ describe('AssetMetadataById request handler', () => { | |||
expect(metadataByIdResponse.denomMetadata?.equals(metadataFromNode)).toBeTruthy(); | |||
}); | |||
|
|||
test('should fail to get metadata when metadata not found in idb and node', async () => { | |||
test('should return an empty response when metadata not found in idb and node', async () => { |
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.
There's really no need to throw, since it's acceptable to return an empty response from this RPC method. So I changed the behavior.
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.
Response on other comment
@@ -458,12 +458,14 @@ export class IndexedDb implements IndexedDbInterface { | |||
}); | |||
} | |||
|
|||
async addEpoch(startHeight: bigint, index?: bigint): Promise<void> { |
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.
We're never actually using the index
argument anywhere, so I just got rid of it.
<ActionDetails.Row label='Epoch index'> | ||
{value.startEpochIndex.toString()} | ||
</ActionDetails.Row> |
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.
This is a little strange to me: the startEpochIndex
property is deprecated, so we should no longer show it. Ideally, we'd show the unbonding start height instead – but that property doesn't exist on the Undelegate
proto! So for now, we'll just hide this, and revisit this if/when core adds that property to the Undelegate
action.
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.
can you leave the code here and just style it hidden or comment it out?
@@ -33,7 +33,7 @@ export const ValueViewComponent = ({ | |||
const value = view.valueView.value; | |||
const metadata = view.valueView.value.metadata; | |||
const amount = value.amount ?? new Amount(); | |||
const exponent = getDisplayDenomExponent(metadata); |
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.
Reviewers: I could use some help here.
When a user clicks the Undelegate button, the transaction approval dialog opens. We try to fetch the metadata for the undelegation tokens they'll be getting, but that will always come back empty, since the unbonding token type is now specific to the block height at which unbonding starts. That is, the unbonding token name is unbonding_start_at_N_penumbravalid1...
, where N
is the block height that unbonding started at.
There will never be token metadata for an unbonding token until after the transaction has been committed to the chain, since the token type is created when the transaction is committed.
But that means that the undelegation tokens are shown as "Unknown asset" in the transaction approval dialog:
Perhaps we should generate the unbonding token metadata on the fly here? If so, could someone point me in the right direction for how to do that? (That said, I'd love to get this PR merged before handling that, since all delegation is blocked until this PR is merged.)
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.
Another wrinkle to all this: this issue, where the metadata request always returns an empty response for an undelegation token that doesn't exist yet, wasn't happening before when undelegation tokens were tied to epochs rather than block heights.
I don't know how that's possible. We should have had the same problem back then, right? That is:
- We transition to a new epoch.
- Someone goes to undelegate tokens from a validator.
- Since no one else has undelegated tokens from that validator in this epoch yet, the metadata for
uunbonding_epoch_N_...
doesn't exist yet, so the metadata response is empty. getDisplayDenomExponent
throws, because it's being passedundefined
metadata.
And yet, this wasn't happening before — no error was being thrown. It only started with this change, where unbonding tokens are tied to block height rather than epoch index.
I'm investigating this, but it's a bit concerning since I don't understand why it worked before!
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.
Perhaps we should generate the unbonding token metadata on the fly here?
The assetMetadataById
rpc method feels like a good place to generate metadata for this edge case so web apps have meaningful display data here.
And yet, this wasn't happening before
Umm, no idea! 😅
let amount = amount | ||
.ok_or_else(|| anyhow!("missing amount in delegation"))? | ||
.try_into()?; | ||
let rate_data: RateData = rate_data | ||
.ok_or_else(|| anyhow!("missing rate data in delegation"))? | ||
.try_into()?; | ||
actions.push(rate_data.build_delegate(amount).into()); | ||
actions.push(rate_data.build_delegate(epoch.into(), amount).into()); |
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.
The epoch in the rate data has been deprecated, so we have to pass it in now.
// it's done. | ||
await this.updateValidatorInfos(0n); | ||
|
||
await this.indexedDb.addEpoch(0n); |
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.
Previously, we were skipping saving the first epoch to the database. This fixes that bug.
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.
Wow, some really domain specific knowledge here 😅 . Good job! Left some comments.
@@ -75,10 +75,11 @@ describe('AssetMetadataById request handler', () => { | |||
expect(metadataByIdResponse.denomMetadata?.equals(metadataFromNode)).toBeTruthy(); | |||
}); | |||
|
|||
test('should fail to get metadata when metadata not found in idb and node', async () => { | |||
test('should return an empty response when metadata not found in idb and node', async () => { |
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.
Response on other comment
@@ -33,7 +33,7 @@ export const ValueViewComponent = ({ | |||
const value = view.valueView.value; | |||
const metadata = view.valueView.value.metadata; | |||
const amount = value.amount ?? new Amount(); | |||
const exponent = getDisplayDenomExponent(metadata); |
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.
Perhaps we should generate the unbonding token metadata on the fly here?
The assetMetadataById
rpc method feels like a good place to generate metadata for this edge case so web apps have meaningful display data here.
And yet, this wasn't happening before
Umm, no idea! 😅
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.
Ah, please also update the proving keys:
const VERSION_TAG = 'v0.68.0'; |
Are we waiting for the 0.71.0 point release later today? |
efb1341
to
f596006
Compare
06d4390
to
d581b4f
Compare
In this PR
uunbonding_epoch_N_penumbravalid1abc123
. Now, unbonding tokens refer to a start block height, rather than a start epoch, so they're of the formunbonding_start_at_N_penumbravalidabc123
. Also, they now have multiple denom units, so the display denom just starts withunbonding_
rather thanuunbonding
.