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

refactor(core-code) Optimisation of read-write structures for code instrumentation #4274

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

Lazark0x
Copy link
Member

@Lazark0x Lazark0x commented Oct 1, 2024

Code structure constructor now returns 3 parameters: InstrumentedCode, OriginalCode and CodeMetadata

CodeMetadata contains all the necessary data to infer the need for code instrumentation

Rewritten precharge to type-state pattern

@Lazark0x Lazark0x added the A0-pleasereview PR is ready to be reviewed by the team label Oct 1, 2024
@Lazark0x Lazark0x self-assigned this Oct 1, 2024
@Lazark0x Lazark0x requested a review from breathx October 1, 2024 22:07
Copy link
Member

@breathx breathx left a comment

Choose a reason for hiding this comment

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

will be refactored as discussed in dm

@breathx breathx added A1-inprogress Issue is in progress or PR draft is not ready to be reviewed and removed A0-pleasereview PR is ready to be reviewed by the team labels Oct 7, 2024
@breathx breathx added the A0-pleasereview PR is ready to be reviewed by the team label Oct 18, 2024
@Lazark0x Lazark0x changed the title refactor(core-code) InstrumentedCode is made a member of the Code refactor(core-code) Optimisation of read-write structures for code instrumentation Oct 21, 2024
@Lazark0x Lazark0x removed the A1-inprogress Issue is in progress or PR draft is not ready to be reviewed label Oct 21, 2024
core/src/code/instrumented.rs Outdated Show resolved Hide resolved
core/src/code/attribution.rs Outdated Show resolved Hide resolved
core/src/code/instrumented.rs Outdated Show resolved Hide resolved
core/src/code/mod.rs Outdated Show resolved Hide resolved
core/src/code/config.rs Outdated Show resolved Hide resolved
pallets/gear/src/runtime_api.rs Outdated Show resolved Hide resolved
common/src/code_storage.rs Outdated Show resolved Hide resolved
core-processor/src/context.rs Outdated Show resolved Hide resolved
pallets/gear/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines 1140 to 1141
T::CodeStorage::update_instrumented_code(code_id, instrumented_code.clone());
T::CodeStorage::update_code_metadata(code_id, metadata);
Copy link
Member

Choose a reason for hiding this comment

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

Functions should be merged like add_code and remove_code

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, made a function in storage that writes both of these values

Copy link
Member

Choose a reason for hiding this comment

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

and didn't use it*

Copy link
Member Author

Choose a reason for hiding this comment

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

The update_instrumented_code_and_metadata function is definitely used in reinstrument_code and in the state_rpc_calls_trigger_reinstrumentation test

@breathx breathx added the A3-gotissues PR occurred to have issues after the review label Nov 4, 2024
@Lazark0x Lazark0x removed the A3-gotissues PR occurred to have issues after the review label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants