-
Notifications
You must be signed in to change notification settings - Fork 87
add ix_path to InstructionUpdate #180
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
base: main
Are you sure you want to change the base?
add ix_path to InstructionUpdate #180
Conversation
crates/core/src/instruction.rs
Outdated
| pub inner: Vec<InstructionUpdate>, | ||
| /// The index of this instruction within the transaction. | ||
| /// always set after parsing. | ||
| pub ix_path: Option<IxPath>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ig we can call is ix_index , wyt @kespinola
| pub ix_path: Option<IxPath>, | |
| pub ix_index: Option<IxIndex>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IxIndex sounds nice but does it imply that the thing is multiple levels deep? I'm good with ix_index nevertheless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path is good with me I'd just call the field path though since its on an instruction update object already.
crates/core/src/instruction.rs
Outdated
| .map(|i| Self::parse_one(Arc::clone(&shared), i)) | ||
| .collect::<Result<Vec<_>, _>>()?; | ||
|
|
||
| for (index_outer, outer_instr) in outer.iter_mut().enumerate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for (index_outer, outer_instr) in outer.iter_mut().enumerate() { | |
| for (index_outer, outer_ix) in outer.iter_mut().enumerate() { |
crates/core/src/instruction.rs
Outdated
|
|
||
| Self::parse_inner(&shared, inner_instructions, &mut outer)?; | ||
|
|
||
| for outer_instr in &outer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above
crates/core/src/instruction.rs
Outdated
| pub inner: Vec<InstructionUpdate>, | ||
| /// The index of this instruction within the transaction. | ||
| /// always set after parsing. | ||
| pub ix_path: Option<IxPath>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason this is optional ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my approach visits the tree after it got constructed and updates the path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anyway to compute it when the InstructionUpdate is being formed so its not an option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm thought a bit about that but it that's not possible without modifying the traversal strategy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to change parse_inner to do traversal before the actual mapping (parse_one_inner)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ig I found an easy way to derive the path from the stack height array
one more question: should we log the path in the places where errors/logs in vixen are referring to an instruction?
| pub struct IxIndex(Vec<u32>); | ||
|
|
||
| impl IxIndex { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are already in instruction module so call perhaps call it path so its instruction::Path
Addresses this issue
Test with filtered-pipeline