-
Notifications
You must be signed in to change notification settings - Fork 202
Make cross regions more typed #923
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,8 +154,12 @@ pub struct RawBundleMetadata { | |
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub bundle_hash: Option<B256>, | ||
| /// Disable multiplexing bundle to other region builders. | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub disable_cross_region_sharing: Option<bool>, | ||
| #[serde(default, skip_serializing_if = "is_false")] | ||
| pub disable_cross_region_sharing: bool, | ||
| } | ||
|
|
||
| fn is_false(b: &bool) -> bool { | ||
| !*b | ||
| } | ||
|
|
||
| impl RawBundleMetadata { | ||
|
|
@@ -234,7 +238,7 @@ impl RawBundleMetadata { | |
| version, | ||
| )); | ||
| } | ||
| if self.disable_cross_region_sharing.is_some() { | ||
| if self.disable_cross_region_sharing { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Subtle behavior change: previously |
||
| return Err(RawBundleConvertError::FieldNotSupportedByVersion( | ||
| "disable_cross_region_sharing".to_owned(), | ||
| version, | ||
|
|
||
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.
Wire-format compatibility note: the old
Option<bool>accepted"disable_cross_region_sharing": nullfrom clients (deserialized toNone). With plainbool, an explicitnullwill now fail deserialization. Omitting the field still works because of#[serde(default)], but if any external producer sends explicitnull, it will break. If you want to keep tolerating that, use#[serde(default, deserialize_with = "...")]to coercenulltofalse, or keep theOption<bool>only onRawBundleMetadataand convert at the boundary.