Skip to content
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

Add metadata hash #1299

Merged
merged 32 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0db3c43
feat: 🎸 add buy-back
yooml Jun 4, 2024
171f9e9
Bifrost v0.10.001
SunTiebing Jun 4, 2024
fcc6100
feat: 🎸 benchmark
yooml Jun 5, 2024
08aa1c2
Merge pull request #1257 from bifrost-finance/add-buy-back
SunTiebing Jun 5, 2024
5b892b4
SLPx mint support commission id (#1261)
SunTiebing Jun 11, 2024
66b0ab0
Add vtoken exchange rate rpc (#1260)
SunTiebing Jun 11, 2024
d87b49b
fix: 🐛 add event (#1263)
yooml Jun 11, 2024
fec4a12
add update_currency_metadata function (#1259)
SunTiebing Jun 11, 2024
96aa7fb
add the use of Vec (#1264)
SunTiebing Jun 12, 2024
a62b6e0
Upgrade to Polkadot-SDK v1.7.0 (#1262)
hqwangningbo Jun 12, 2024
5507754
Fix compile
hqwangningbo Jun 13, 2024
489fc9c
feat: 🎸 add metadata-hash-extension (#1265)
yooml Jun 13, 2024
d9f9a6c
feat: 🎸 add metadata-hash-extension
yooml Jun 12, 2024
3fe0b79
Fix compile (#1266)
hqwangningbo Jun 13, 2024
7b0aaaf
Fix/fix vtoken voting unlock (#1267)
SunTiebing Jun 13, 2024
3f7d6b2
Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268)
yooml Jun 18, 2024
d03e60d
rename the version number to 0.11.0
SunTiebing Jun 18, 2024
fa21d8e
Slp supports XCMv4 and reconstruct integration tests (#1272)
hqwangningbo Jun 19, 2024
75df8c6
Feat/slpx mint add commission (#1273)
SunTiebing Jun 19, 2024
ecc906a
Feat/add vtoken exchange rate rpc (#1274)
SunTiebing Jun 20, 2024
66a3ce7
fix bug: storage migration anomaly (#1276)
SunTiebing Jun 21, 2024
b4fdc81
Slp removes refund (#1275)
hqwangningbo Jun 21, 2024
7e58dc5
Feat/add vtoken exchange rate rpc (#1277)
SunTiebing Jun 21, 2024
299d779
Remove dmp queue (#1279)
hqwangningbo Jun 24, 2024
a732a47
fix: 🐛 CheckMetadataHash to false
yooml Jul 3, 2024
90540c5
fix: 🐛 update sp-api
yooml Jul 3, 2024
481c80f
refactor: 💡 fmt
yooml Jul 4, 2024
1385798
fix: 🐛 add metadata-hash
yooml Jul 4, 2024
3ed618a
fix: 🐛 add feature metadata-hash
yooml Jul 4, 2024
1d3bfca
Merge branch 'v0.11.0' of github.com:bifrost-finance/bifrost into add…
yooml Jul 5, 2024
e8a283c
feat: 🎸 merge develop
yooml Jul 5, 2024
6c74822
fix: 🐛 rm metadata-hash feature
yooml Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 78 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ cumulus-primitives-utility = { version = "0.8.0", default-featur
cumulus-test-relay-sproof-builder = { version = "0.8.0", default-features = false }
frame-benchmarking = { version = "29.0.0", default-features = false }
frame-executive = { version = "29.0.0", default-features = false }
frame-metadata-hash-extension = { version = "0.1.0", default-features = false }
frame-support = { version = "29.0.0", default-features = false }
frame-system = { version = "29.0.0", default-features = false }
frame-system-benchmarking = { version = "29.0.0", default-features = false }
Expand Down Expand Up @@ -181,7 +182,7 @@ polkadot-parachain-primitives = { version = "7.0.0", default-featur
polkadot-primitives = { version = "8.0.0", default-features = false }
polkadot-runtime-common = { version = "8.0.0", default-features = false }
polkadot-runtime-parachains = { version = "8.0.0", default-features = false }
sp-api = { version = "27.0.0", default-features = false }
sp-api = { version = "27.0.1", default-features = false }
sp-application-crypto = { version = "31.0.0", default-features = false }
sp-arithmetic = { version = "24.0.0", default-features = false }
sp-authority-discovery = { version = "27.0.0", default-features = false }
Expand Down Expand Up @@ -266,7 +267,7 @@ sp-rpc = { version = "27.0.0" }
substrate-build-script-utils = { version = "11.0.0" }
substrate-frame-rpc-system = { version = "29.0.0" }
substrate-prometheus-endpoint = { version = "0.17.0" }
substrate-wasm-builder = { version = "18.0.0" }
substrate-wasm-builder = { version = "18.0.1" }
try-runtime-cli = { version = "0.39.0" }
xcm-emulator = { version = "0.6.0" }
xcm-simulator = { version = "8.0.0" }
Expand Down
2 changes: 1 addition & 1 deletion node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ with-bifrost-kusama-runtime = ["bifrost-service/with-bifrost-kusama-runtime"]
with-bifrost-polkadot-runtime = ["bifrost-service/with-bifrost-polkadot-runtime"]
with-all-runtime = ["with-bifrost-runtime"]
try-runtime = ["bifrost-service/try-runtime", "try-runtime-cli/try-runtime"]
fast-runtime = ["bifrost-service/fast-runtime"]
fast-runtime = ["bifrost-service/fast-runtime"]
1 change: 0 additions & 1 deletion node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,3 @@ fast-runtime = [
"bifrost-kusama-runtime/fast-runtime",
"bifrost-polkadot-runtime/fast-runtime",
]

6 changes: 5 additions & 1 deletion runtime/bifrost-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ serde_json = { workspace = true }
# frame dependencies
frame-benchmarking = { workspace = true, optional = true }
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true, features = ["tuples-96"] }
frame-system = { workspace = true }
frame-system-benchmarking = { workspace = true, optional = true }
Expand Down Expand Up @@ -158,6 +159,7 @@ std = [

"frame-benchmarking?/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
Expand Down Expand Up @@ -394,6 +396,8 @@ try-runtime = [
"bifrost-channel-commission/try-runtime",
]

# Enable the metadata hash generation in the wasm builder.
metadata-hash = ["substrate-wasm-builder?/metadata-hash"]
# When enabled, the runtime API will not be build.
#
# This is required by Cumulus to access certain types of the
Expand All @@ -404,7 +408,7 @@ disable-runtime-api = []
# A feature that should be enabled when the runtime should be build for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]
on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"]

# Set timing constants (e.g. session period) to faster versions to speed up testing.
fast-runtime = []
13 changes: 8 additions & 5 deletions runtime/bifrost-kusama/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "metadata-hash"))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("BNC", 12)
.build()
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
substrate_wasm_builder::WasmBuilder::build_using_defaults()
}

#[cfg(not(feature = "std"))]
fn main() {}
2 changes: 2 additions & 0 deletions runtime/bifrost-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ where
frame_system::CheckNonce::<Runtime>::from(nonce),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
);
let raw_payload = SignedPayload::new(call, extra)
.map_err(|e| {
Expand Down Expand Up @@ -2020,6 +2021,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand Down
6 changes: 5 additions & 1 deletion runtime/bifrost-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ serde_json = { workspace = true }
# frame dependencies
frame-benchmarking = { workspace = true, optional = true }
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true, features = ["tuples-96"] }
frame-system = { workspace = true }
frame-system-benchmarking = { workspace = true, optional = true }
Expand Down Expand Up @@ -155,6 +156,7 @@ std = [
"strum/std",

"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
Expand Down Expand Up @@ -369,6 +371,8 @@ try-runtime = [
"zenlink-protocol/try-runtime",
]

# Enable the metadata hash generation in the wasm builder.
metadata-hash = ["substrate-wasm-builder?/metadata-hash"]
# When enabled, the runtime API will not be build.
#
# This is required by Cumulus to access certain types of the
Expand All @@ -379,7 +383,7 @@ disable-runtime-api = []
# A feature that should be enabled when the runtime should be build for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]
on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"]

# Set timing constants (e.g. session period) to faster versions to speed up testing.
fast-runtime = []
13 changes: 8 additions & 5 deletions runtime/bifrost-polkadot/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "metadata-hash"))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("BNC", 12)
.build()
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
substrate_wasm_builder::WasmBuilder::build_using_defaults()
}

#[cfg(not(feature = "std"))]
fn main() {}
1 change: 1 addition & 0 deletions runtime/bifrost-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1854,6 +1854,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand Down