-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Introduce automatic ABI maintenance mechanism (2/2; rollout) #8012
Introduce automatic ABI maintenance mechanism (2/2; rollout) #8012
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8012 +/- ##
========================================
+ Coverage 81.9% 82.1% +0.1%
========================================
Files 310 316 +6
Lines 71844 71960 +116
========================================
+ Hits 58903 59095 +192
+ Misses 12941 12865 -76 |
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.
direction looks great so far
b3b65b0
to
356a91c
Compare
@mvines Status update! Almost feature complete... Still, the main files are WAAAYY ugly. Don't even look at it. Let's start with easy documentations. Currently I'm intentionally making CI red to show the ABI test is actually failing at the [note to be source-commented]: The
And all of combinations (= 8) should be working now. I've constructed rather complicated plumbing for my teammates to avoid Is there any thoughts in the cfg & usage aspects? |
446d117
to
afe2ad5
Compare
SKIP |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale pull request has been automatically closed. Thank you for your contributions. |
5ca19c4
to
28a7c0e
Compare
$ diff -u /tmp/abi8/*7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj* /tmp/abi8/*9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w* --- /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj 2020-06-18 18:01:22.831228087 +0900 +++ /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w 2020-07-03 15:59:58.430695244 +0900 @@ -140,7 +140,7 @@ field u8 primitive u8 field solana_sdk::instruction::InstructionError - enum InstructionError (variants = 34) + enum InstructionError (variants = 35) variant(0) GenericError (unit) variant(1) InvalidArgument (unit) variant(2) InvalidInstructionData (unit) @@ -176,6 +176,7 @@ variant(31) CallDepth (unit) variant(32) MissingAccount (unit) variant(33) ReentrancyNotAllowed (unit) + variant(34) MaxSeedLengthExceeded (unit) variant(9) CallChainTooDeep (unit) variant(10) MissingSignatureForFee (unit) variant(11) InvalidAccountIndex (unit)
97fdf10
to
0ad297e
Compare
#p!("sed -i -e 's/{}/{}/g' $(git grep --files-with-matches frozen_abi)", #expected_digest, hash); | ||
} | ||
::log::warn!("Not testing the abi digest under SOLANA_ABI_BULK_UPDATE!"); | ||
} else { | ||
assert_eq!(#expected_digest, format!("{}", hash), "Possibly ABI changed? Confirm the diff by rerunning before and after this test failed with SOLANA_ABI_DUMP_DIR"); | ||
if let Ok(dir) = ::std::env::var("SOLANA_ABI_DUMP_DIR") { | ||
assert_eq!(#expected_digest, actual_digest, "Possibly ABI changed? Examine the diff in SOLANA_ABI_DUMP_DIR!: $ diff -u {}/*{}* {}/*{}*", dir, #expected_digest, dir, actual_digest); |
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.
@@ -74,6 +74,7 @@ pub const SECONDS_PER_YEAR: f64 = 365.25 * 24.0 * 60.0 * 60.0; | |||
pub const MAX_LEADER_SCHEDULE_STAKES: Epoch = 5; | |||
|
|||
type BankStatusCache = StatusCache<Result<()>>; | |||
#[frozen_abi(digest = "9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w")] |
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.
@mvines I think this pr is ready for review and merge! I've rebased and there was little abi changes so far. So, it looks like there will be little churn for engineers to endure even after merging this. :) |
@@ -8,6 +10,9 @@ pub(super) struct SerializableAccountStorageEntry { | |||
count_and_status: (usize, AccountStorageStatus), | |||
} | |||
|
|||
#[cfg(all(test, RUSTC_WITH_SPECIALIZATION))] | |||
impl IgnoreAsHelper for SerializableAccountStorageEntry {} |
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.
It would be nice to have some brief documentation on when IgnoreAsHelper
should be used, perhaps in
docs/src/implemented-proposals/abi-management.md
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 see! I'll do this as a follow-up pr.
@@ -52,6 +52,7 @@ _ ci/order-crates-for-publishing.py | |||
_ cargo +"$rust_stable" fmt --all -- --check | |||
|
|||
# -Z... is needed because of clippy bug: https://github.com/rust-lang/rust-clippy/issues/4612 | |||
# run nightly clippy for `sdk/` as there's a moderate amount of nightly-only code there |
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.
here: #31833
Problem
ABI can change without noticing.
Summary of Changes
This pr is currently only containing the actual rollout code to enable frozen abi. most are quite simple. But some are advanced. :) I'll hope this pr will become an example repository pr for future abi maintenance by our team mates. :)
This landed on #10335
todo
- [ ] backport to v0.23- [ ] Once merged, add morefrozen_abi
to other top most types for serialization.Was split to #10335
Fixes #7738