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

[cherrypick][jsonrpc] fix estimated rewards during safe mode (#20182) #20187

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

emmazzz
Copy link
Contributor

@emmazzz emmazzz commented Nov 6, 2024

Description

Currently if the exchange rate for an epoch is not found, we would assign it the default exchange rate while we should've used the exchange rate from the previous existing epoch instead. This PR fixes that.

Test plan

Added some unit tests.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC: fixed reward estimation in getStakes API so that we don't overestimate stake rewards of stakes activated during safe mode epochs.
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Description

Describe the changes or additions included in this PR.

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 12, 2024 2:57am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 2:57am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 2:57am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 2:57am

@emmazzz emmazzz temporarily deployed to sui-typescript-aws-kms-test-env November 6, 2024 00:19 — with GitHub Actions Inactive
@emmazzz emmazzz changed the title [jsonrpc] fix estimated rewards during safe mode (#20182) [cherrypick][jsonrpc] fix estimated rewards during safe mode (#20182) Nov 6, 2024
## Description 

Currently if the exchange rate for an epoch is not found, we would
assign it the default exchange rate while we should've used the exchange
rate from the previous existing epoch instead. This PR fixes that.

## Test plan 

Added some unit tests.

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [x] JSON-RPC: fixed reward estimation in `getStakes` API so that we
don't overestimate stake rewards of stakes activated during safe mode
epochs.
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
Waiting on dependent packages to update.
## Description

We are not using this dependency and `cargo deny` includes an advisory
that it has been rolled into `opentelemetry`, which this change
silences.

## Test plan

CI
## Description

`derivative` is unmaintained. Switch existing uses to use `derive_more`
instead, which is an existing dependency that has all the necessary
features.

This also required bumping `derive_more` to `1.0.0`, which introduced
some small breaking changes, and means that we are pulling in two
versions of `derive_more` due to transitive dependency constraints, but
in this case, it should be okay because we are mainly using this dep for
its proc macros, and one hopes that eventually the transitive deps will
upgrade to `1.x` as well.

## Test plan

CI
@emmazzz emmazzz temporarily deployed to sui-typescript-aws-kms-test-env November 12, 2024 02:56 — with GitHub Actions Inactive
@emmazzz emmazzz merged commit f77489d into releases/sui-v1.37.0-release Nov 12, 2024
52 checks passed
@emmazzz emmazzz deleted the emma/pick-20182-1.37 branch November 12, 2024 03:22
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