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

chore(ctx): replace gstuff constructible with oncelock #2267

Merged
merged 6 commits into from
Dec 10, 2024
Merged

Conversation

borngraced
Copy link
Member

@borngraced borngraced commented Nov 6, 2024

#1309

Replaced Constructible from the gstuff crate with once_cell::sync::OnceCell for managing lazy-initialized values in mm_ctx for better performance and stronger thread safety.

also add a slight improvement to from_ctx

@borngraced borngraced self-assigned this Nov 6, 2024
use lazy_static::lazy_static;
use libp2p::PeerId;
use mm2_event_stream::{controller::Controller, Event, EventStreamConfiguration};
use mm2_metrics::{MetricsArc, MetricsOps};
use once_cell::sync::OnceCell;
Copy link
Member

Choose a reason for hiding this comment

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

Why not OnceLock from the standard library?

Copy link
Member Author

@borngraced borngraced Nov 7, 2024

Choose a reason for hiding this comment

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

ah thanks!, I promise, I didn't know this is stable already..also I've had OnceCell on my mind for a long time.

mm2src/mm2_core/src/mm_ctx.rs Show resolved Hide resolved
mm2src/mm2_core/src/mm_ctx.rs Outdated Show resolved Hide resolved
@borngraced borngraced changed the title chore(ctx): replace gstuff constructible with once_cell chore(ctx): replace gstuff constructible with oncelock Nov 8, 2024
mariocynicys
mariocynicys previously approved these changes Dec 9, 2024
Copy link
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

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

One comment inline, LGTM otherwise :)

mm2src/coins/z_coin/storage/blockdb/blockdb_sql_storage.rs Outdated Show resolved Hide resolved
mariocynicys
mariocynicys previously approved these changes Dec 9, 2024
Copy link
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

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

non-blockers.
LGTM :)

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

LGTM!

@shamardy shamardy merged commit ac926dd into dev Dec 10, 2024
35 of 46 checks passed
@shamardy shamardy deleted the improve-mm_ctx branch December 10, 2024 17:59
onur-ozkan added a commit that referenced this pull request Dec 19, 2024
* feat(LRAPI): add 1inch classic swap rpc (#2222)

This commit adds initial code to connect to 1inch Liquidity Routing API (LRAPI) provider and two new RPCs to use 1inch classic swap API. It also adds 'approve' and 'allowance' RPCs (for ERC20 tokens).

* chore(release): bump mm2 version to 2.3.0-beta (#2285)

* improvement(error-handling): main files (#2288)

Makes KDF to check main files (config/coins/etc..) before reading them to prevent potential panics.

* fix(rpc): remove character check blocking password input (#2287)

This commit removes check for <, >, & characters in RPC request bodies that was incorrectly blocking valid password characters in get_mnemonic RPC call. These special characters should be allowed in passwords.

This aligns native behavior with WASM implementation.

* don't rely on core (#2289)

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* chore(ctx): replace gstuff constructible with oncelock (#2267)

* chore(adex-cli): use "Komodo DeFi Framework" name in adex_cli  (#2290)

* bump libp2p (#2296)

Signed-off-by: onur-ozkan <work@onurozkan.dev>

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Co-authored-by: dimxy <dimxy@komodoplatform.com>
Co-authored-by: Onur Özkan <work@onurozkan.dev>
Co-authored-by: Samuel Onoja <samiodev@icloud.com>
Co-authored-by: DeckerSU <support@decker.su>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants