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(blockifier): store block_context as Arc in TransactionContext #4157

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

liorgold2
Copy link
Contributor

No description provided.

@liorgold2 liorgold2 requested a review from elintul February 14, 2025 15:04
@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

github-actions bot commented Feb 14, 2025

Artifacts upload workflows:

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @liorgold2)


-- commits line 2 at r1:
What's the context? What's the feature your working and your plan?

Code quote:

store block_context as Arc in TransactionContext

crates/blockifier/src/context.rs line 27 at r1 (raw file):

#[derive(Clone, Debug)]
pub struct TransactionContext {

Consider implementing new c-tor, to encapsulate this.

Code quote:

TransactionContext

Copy link
Contributor Author

@liorgold2 liorgold2 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: all files reviewed, 2 unresolved discussions (waiting on @elintul)


-- commits line 2 at r1:

Previously, elintul (Elin) wrote…

What's the context? What's the feature your working and your plan?

Adding a meta-tx syscall. This will require creating a TransactionContext with a different tx_info, but the same block_info. So I'm changing it to Arc to avoid cloning it.

Copy link
Contributor Author

@liorgold2 liorgold2 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: all files reviewed, 1 unresolved discussion (waiting on @elintul)


crates/blockifier/src/context.rs line 27 at r1 (raw file):

Previously, elintul (Elin) wrote…

Consider implementing new c-tor, to encapsulate this.

Noted. I think BlockContext should be Arc in more places, so a constructor from BlockContext that wraps it in Arc is problematic.

Copy link
Collaborator

@elintul elintul 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @liorgold2)


crates/blockifier/src/context.rs line 27 at r1 (raw file):

Previously, liorgold2 wrote…

Noted. I think BlockContext should be Arc in more places, so a constructor from BlockContext that wraps it in Arc is problematic.

Not sure I understood.

Copy link
Contributor Author

@liorgold2 liorgold2 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @liorgold2)


crates/blockifier/src/context.rs line 27 at r1 (raw file):

Previously, elintul (Elin) wrote…

Not sure I understood.

The question is what the new constructor will get.

  • If it gets Arc<BlockContext> then it doesn't encapsulates it.
  • If it gets BlockContext then it needs to create an Arc, but I don't think this is what I want to encourage - if you have an Arc<BlockContext> and you want to create TransactionContext, then you won't be able to pass through this constructor.

Copy link
Collaborator

@elintul elintul 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @liorgold2)


crates/blockifier/src/context.rs line 27 at r1 (raw file):

Previously, liorgold2 wrote…

The question is what the new constructor will get.

  • If it gets Arc<BlockContext> then it doesn't encapsulates it.
  • If it gets BlockContext then it needs to create an Arc, but I don't think this is what I want to encourage - if you have an Arc<BlockContext> and you want to create TransactionContext, then you won't be able to pass through this constructor.

Okay, I see. Keep in mind as this feature goes, that if the second one is the more common case, new c-tor can be considered.

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @liorgold2)

@liorgold2 liorgold2 added this pull request to the merge queue Feb 16, 2025
Merged via the queue into main with commit b51a6ec Feb 16, 2025
22 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants