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

feat: P-chain dynamic fees #74

Merged
merged 15 commits into from
Nov 21, 2024
Merged

feat: P-chain dynamic fees #74

merged 15 commits into from
Nov 21, 2024

Conversation

meeh0w
Copy link
Member

@meeh0w meeh0w commented Oct 18, 2024

Related PRs:

TODOs

  • Release stable versions of above SDKs & update versions in here

Changes

  • Updates getProviderForNetwork() util to be async, since we now need to fetch the upgradesInfo object first
  • Updates AccountsService & SecretsService so that account addresses are recalculated if devnet is selected (X/P chain prefix is different - custom)
  • Updates Send screen for P-Chain, so that the fee widget is displayed if Etna upgrade is activated on the currently selected network
  • Updates CustomFees component to allow making it collapsible:
    • It's not collapsed by default (existing screens are not affected)
    • If collapsible = true, it shows as collapsed by default (only the case P-Chain send screen with Etna upgrade activated)
  • Updates XP approval screens

Testing

  • Make sure X/P addresses are resolved properly & try to break it (i.e. switch network/testnet mode multiple times in quick succession)
    • When on mainnet, no prefix
    • When on testnet, fuji prefix
    • When on devnet, custom prefix

Backwards compatibility

  • Interact with Core Web / Ava Cloud as usual
  • Perform Send on Mainnet / Fuji P-Chain
  • Use the hosted playground
    • Make sure your active network is not the devnet

Etna upgrade compatibility

  • Activate Avalanche Etna P-Devnet first
  • Perform Send
    • Make sure fee widget shows up & is editable
  • Pull & build the new playground locally
    • Perform transactions there

Checklist for the author

  • I've covered new/modified business logic with Jest test cases.
  • I've tested the changes myself before sending it to code review and QA.

@meeh0w meeh0w changed the title wip: p-chain dynamic fees feat: P-chain dynamic fees Oct 31, 2024
({ chainId, networkBalances }) =>
!isEqual(networkBalances, this.balances[chainId])
)
.filter(({ chainId, networkBalances }) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes a bug I've noticed in the P-Chain balances fetching.

Basically, when user has multiple accounts derived, we would always detect changes here because we only poll for the active account and we'd have balances for multiple addresses cached.

@meeh0w meeh0w marked this pull request as ready for review November 4, 2024 13:00
bferenc
bferenc previously approved these changes Nov 18, 2024
@meeh0w meeh0w merged commit 780b9b5 into main Nov 21, 2024
6 checks passed
@meeh0w meeh0w deleted the feat/pchain-dynamic-fees branch November 21, 2024 20:36
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.

3 participants