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

feat(node): support read only txn #1291

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

feat(node): support read only txn #1291

wants to merge 13 commits into from

Conversation

cryptoAtwill
Copy link
Contributor

@cryptoAtwill cryptoAtwill commented Feb 18, 2025

This PR adds the functionality of read only txn that can perform queries over the latest in memory changes of the fvm execution state.

The read only execution is delegated to fvm. Also it bumps the rust version to 1.83.0 as there were some crates conflict.
Fixed a few clippy issues.


This change is Reviewable

@cryptoAtwill cryptoAtwill requested a review from a team as a code owner February 18, 2025 05:33
@LePremierHomme
Copy link
Contributor

@cryptoAtwill closes #1236 ?

msg,
ApplyKind::Implicit,
raw_length,
true,
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: Maybe we can have:

const WITH_REVERT: bool = true;

and the use it here instead? Just to not have a magical boolean here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am a friend of enums

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the case here, I think a bool might just work because there are just two cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't matter the number of cases, when in calling code foo(true, false, true) bears no meaning while foo(ExecPersistence::Revert, ExecPersistence::Apply, ExecPersistence::Revert) does. Ignore the specific naming.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

understand where you are coming from. Updated the naming slightly to reflect the changes you mentioned. If I use an enum here, I still have to convert to bool. Will take note of this for future changes.

Copy link
Contributor

@drahnr drahnr left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 14 files reviewed, 6 unresolved discussions (waiting on @cryptoAtwill, @karlem, and @LePremierHomme)


ipc/provider/src/config/deserialize.rs line 44 at r1 (raw file):

{
    struct Visitor;
    impl serde::de::Visitor<'_> for Visitor {

These are clippy artifacts from the rust version bump. We should strive to separate them out

msg,
ApplyKind::Implicit,
raw_length,
true,
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a friend of enums

Copy link
Contributor Author

@cryptoAtwill cryptoAtwill left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 14 files reviewed, 6 unresolved discussions (waiting on @drahnr, @karlem, and @LePremierHomme)


ipc/provider/src/config/deserialize.rs line 44 at r1 (raw file):

Previously, drahnr (Bernhard Schuster) wrote…

These are clippy artifacts from the rust version bump. We should strive to separate them out

understand, I will create a separate PR next time. This one I think it's still manageable, so I just put them into one.

msg,
ApplyKind::Implicit,
raw_length,
true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the case here, I think a bool might just work because there are just two cases.

@cryptoAtwill cryptoAtwill requested a review from drahnr February 19, 2025 13:41
@drahnr drahnr requested a review from karlem February 24, 2025 16:15
Copy link
Contributor

@drahnr drahnr left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 14 files reviewed, 6 unresolved discussions (waiting on @cryptoAtwill, @karlem, and @LePremierHomme)


Cargo.toml line 146 at r2 (raw file):

reqwest = { version = "0.11.13", features = ["json"] }
sha2 = "0.10"
serde = { version = "1.0.217", features = ["derive"] }

Any particular reason we need this patch version

msg,
ApplyKind::Implicit,
raw_length,
true,
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't matter the number of cases, when in calling code foo(true, false, true) bears no meaning while foo(ExecPersistence::Revert, ExecPersistence::Apply, ExecPersistence::Revert) does. Ignore the specific naming.

Copy link
Contributor Author

@cryptoAtwill cryptoAtwill left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 14 files reviewed, 6 unresolved discussions (waiting on @drahnr, @karlem, and @LePremierHomme)


Cargo.toml line 146 at r2 (raw file):

Previously, drahnr (Bernhard Schuster) wrote…

Any particular reason we need this patch version

It's having crate conflict with ref-fvm, ref-fvm requires a higher version.

msg,
ApplyKind::Implicit,
raw_length,
true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

understand where you are coming from. Updated the naming slightly to reflect the changes you mentioned. If I use an enum here, I still have to convert to bool. Will take note of this for future changes.

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.

4 participants