Skip to content

Commit

Permalink
[child effects refactor] Cleanup protocol config checks (#21186)
Browse files Browse the repository at this point in the history
## Description 

- `loaded_child_object_format` and `loaded_child_object_format_type` are
always true in this execution version

## Test plan 

- Ran tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
tnowacki authored Feb 14, 2025
1 parent 11aeb90 commit a8412b3
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ impl<'a> ChildObjectStore<'a> {
));
};

let mut value = if let Some(ChildObject { ty, value, .. }) = self.store.remove(&child) {
let mut value = if let Some(ChildObject { value, .. }) = self.store.remove(&child) {
if value.exists()? {
return Err(
PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR)
Expand All @@ -595,20 +595,7 @@ impl<'a> ChildObjectStore<'a> {
),
);
}
if self.inner.protocol_config.loaded_child_object_format() {
// double check format did not change
if !self.inner.protocol_config.loaded_child_object_format_type() && child_ty != &ty
{
let msg = format!("Type changed for child {child} when setting the value back");
return Err(
PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR)
.with_message(msg),
);
}
value
} else {
GlobalValue::none()
}
value
} else {
GlobalValue::none()
};
Expand Down

0 comments on commit a8412b3

Please sign in to comment.