Skip to content

Conversation

@mina86
Copy link
Contributor

@mina86 mina86 commented Aug 24, 2023

lazy-static is often no longer necessary now that OnceCell and OnceLock
are a thing. Furthermore, in case of price-feed the lazy initialisation
isn’t even necessary: there’s so few entries in mapping that it’s enough
to use a static array than build a hash map.

Readjust the code to use said static array and remove dependency on
lazy-static.

Required for merge:

  • pr-workflow-check / draft-release-check is ✅ success
  • Other rules GitHub shows you, or can be read in configuration

Makes review faster:

  • PR title is my best effort to provide summary of changes and has clear text to be part of release notes
  • I marked PR by misc label if it should not be in release notes
  • Linked Zenhub/Github/Slack/etc reference if one exists
  • I was clear on what type of deployment required to release my changes (node, runtime, contract, indexer, on chain operation, frontend, infrastructure) if any in PR title or description
  • Added reviewer into Reviewers
  • I tagged(@) or used other form of notification of one person who I think can handle best review of this PR
  • I have proved that PR has no general regressions of relevant features and processes required to release into production
  • Any dependency updates made, was done according guides from relevant dependency
  • Clicking all checkboxes
  • Adding detailed description of changes when it feels appropriate (for example when PR is big)

@github-actions
Copy link

Pull reviewers stats

Stats of the last 30 days for composable:

User Total reviews Time to review Total comments
dzmitry-lahoda 27 8h 13m 13
blasrodri 20 2h 11m 7
mina86 17 12h 48m 56
kkast 11 3h 17m 7
RustNinja 10 2h 9m 0
vmarkushin 5 7h 2
JafarAz 3 9h 25m 0
0xBrainjar2 2 3d 17h 35m 6

@github-actions
Copy link

# run Composable node
nix run "github:ComposableFi/composable/refs/pull/4104/merge" --allow-import-from-derivation --extra-experimental-features "flakes nix-command" --no-sandbox --accept-flake-config --option sandbox relaxed
# run local Picasso DevNet (for CosmWasm development)
nix run "github:ComposableFi/composable/refs/pull/4104/merge#devnet-picasso" --allow-import-from-derivation --extra-experimental-features "flakes nix-command" --no-sandbox --accept-flake-config --option sandbox relaxed 
# CosmWasm on Substrate CLI tool
nix run "github:ComposableFi/composable/refs/pull/4104/merge#ccw" --allow-import-from-derivation --extra-experimental-features "flakes nix-command" --no-sandbox --accept-flake-config --option sandbox relaxed 
# run cross chain devnet with Dotsama and Cosmos nodes 
nix run "github:ComposableFi/composable/refs/pull/4104/merge#devnet-xc-fresh" --allow-import-from-derivation --extra-experimental-features "flakes nix-command" --no-sandbox --accept-flake-config --option sandbox relaxed 
# or same with docker
nix build "github:ComposableFi/composable/refs/pull/4104/merge#devnet-xc-image" --allow-import-from-derivation --extra-experimental-features "flakes nix-command" --no-sandbox --accept-flake-config --option sandbox relaxed \
&& docker load --input result && docker run -it --entrypoint bash devnet-xc:latest -c /bin/devnet-xc-fresh 

About nix

@mina86 mina86 marked this pull request as ready for review August 24, 2023 18:52
@mina86 mina86 changed the title Mpn/e WIP Aug 24, 2023
@github-actions
Copy link

stale-pr

@github-actions github-actions bot added the Stale-item bot: Stale PRs and issues handling #owned:terraform label Aug 29, 2023
@mina86 mina86 removed the Stale-item bot: Stale PRs and issues handling #owned:terraform label Aug 31, 2023
@mina86 mina86 changed the title WIP chore(price-feed): remove use of lazy-static Aug 31, 2023
Copy link
Contributor

@dzmitry-lahoda dzmitry-lahoda left a comment

Choose a reason for hiding this comment

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

removing code is good, so i think assets must be read from some registry and price feed as technology bith web2 and web3 parts are dead.

lazy-static is often no longer necessary now that OnceCell and OnceLock
are a thing.  Furthermore, in case of price-feed the lazy initialisation
isn’t even necessary: there’s so few entries in mapping that it’s enough
to use a static array than build a hash map.

Readjust the code to use said static array and remove dependency on
lazy-static.
@mina86 mina86 enabled auto-merge (squash) August 31, 2023 18:11
@mina86 mina86 merged commit 6fbb524 into main Aug 31, 2023
@mina86 mina86 deleted the mpn/e branch August 31, 2023 18: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