Introduce automatic ABI maintenance mechanism (2/2; rollout)#8012
Introduce automatic ABI maintenance mechanism (2/2; rollout)#8012ryoqun merged 8 commits intosolana-labs:masterfrom
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 |
mvines
left a comment
There was a problem hiding this comment.
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
| } 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); |
| pub const MAX_LEADER_SCHEDULE_STAKES: Epoch = 5; | ||
|
|
||
| type BankStatusCache = StatusCache<Result<()>>; | ||
| #[frozen_abi(digest = "9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w")] |
|
@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. :) |
| } | ||
|
|
||
| #[cfg(all(test, RUSTC_WITH_SPECIALIZATION))] | ||
| impl IgnoreAsHelper for SerializableAccountStorageEntry {} |
There was a problem hiding this comment.
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.
I see! I'll do this as a follow-up pr.
| _ 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 |
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_abito other top most types for serialization.Was split to #10335
Fixes #7738