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

fix: cf_pools_environment rpc encoding #4674

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

AlastairHolmes
Copy link
Contributor

The problem here was we tried to serialise a non-string json object as the key to a json map. This happened as the OldAsset encodes all the old assets as strings of the asset name i.e. "Eth", but the newer recently introduced assets like Arbitrum-Eth as a pair of chain and asset. So we can disambiguate which version of Eth it is.

@AlastairHolmes AlastairHolmes added bug Something isn't working non-breaking Merging this PR will create a cherry-pick onto release labels Mar 21, 2024
@AlastairHolmes AlastairHolmes force-pushed the fix/cf_pools_environment_encoding branch from e5078bc to 2d8d90f Compare March 21, 2024 13:18
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 72%. Comparing base (7185a8c) to head (2d8d90f).

Files Patch % Lines
state-chain/custom-rpc/src/lib.rs 74% 8 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4674   +/-   ##
=====================================
  Coverage     72%     72%           
=====================================
  Files        413     413           
  Lines      68348   68350    +2     
  Branches   68348   68350    +2     
=====================================
+ Hits       49057   49061    +4     
+ Misses     16889   16886    -3     
- Partials    2402    2403    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dandanlen dandanlen merged commit b1f4da7 into main Mar 21, 2024
43 checks passed
@dandanlen dandanlen deleted the fix/cf_pools_environment_encoding branch March 21, 2024 13:49
ahasna added a commit that referenced this pull request Mar 21, 2024
* fix(github_actions/release_checks): update confusing runtime spec version check 🤦‍♂️ (#4672)

* fix: submission watcher could confuse/lose track of submissions (#4667)

* fix: ensure always unique IDs

The request ids could be reused, but submissions could last longer than the lifetime of the original request. Sometimes request_id (+ submission_id) was not unique. This was a particular problem, with `submission_status_futures` where an old submission could be confused as being for a newer request. And we could think a submission of the new request was in a block, when it wasn't, but actually it was just the old requests submission that was in the block.

* fix: allow submissions from different requests with matching nonce and submission_id

Basically previously we would lose track of some submissions under some specific unlikely situations. As we used a BTreeMap over submission_id which aren't globally unique (Only unique to a single request). This would previously cause the submission-watcher to miss a successful submission and retry or fail the request.

* refactor: simplify internal behaviour

The submission_status_future is no longer valid at this point, and we know it can be removed. By moving the remove outside the if, we ensure submission_status_futures is always inline with the submissions in submission_by_nonce, i.e. that both storage items have matching understanding of the pending submissions.

Note the `self.submissions_by_nonce.remove(nonce)` above this. Here the change is basically that everytime we remove i.e. `self.submissions_by_nonce.remove(nonce)` we should remove all the matching submissions from `submission_status_futures` so they are kept up to date.

**This was not a bug**

* fix: cf_pools_environment rpc encoding (#4674)

* chore: bump version to 1.3.1

---------

Co-authored-by: Assem <asem.hasna@gmail.com>
Co-authored-by: Alastair Holmes <42404303+AlastairHolmes@users.noreply.github.com>
syan095 added a commit that referenced this pull request Mar 22, 2024
…tation

* origin/main:
  feat: support account deletion (#4314)
  fix: cf_pools_environment rpc encoding (#4674)
  fix: submission watcher could confuse/lose track of submissions (#4667)
  fix(github_actions/release_checks): update confusing runtime spec version check 🤦‍♂️ (#4672)
  feat: fix log messages, evm chain specific (#4652)
  fix: remove cfe events migration (#4671)
  chore: run CI on `nscloud` runners 🚀 (#4505)
  logging: lp-api panic in submission watcher  (#4664)
  chore(localnet): append timestamp to log files 🪵 (#4660)
  fix(chainflip-broker-api): replace u128 with U256 (#4656)
  fix: remove unused cli command line options (#4644)
  chore: revert addition of cargo make (#4659)
  fix: correct cfe-events pallet version (#4658)
  chore: update systemd config to match 1.4 version 🚀 (#4655)
  fix: publish `chainflip-engine1.3` to debian packages 🐞 (#4653)
  Remove aptly check from publish workflow (#4650)
  fix: more try-runtime unwraps. (#4648)
  feat: RPC for returning scale-encoded System events (#4638)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Merging this PR will create a cherry-pick onto release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants