Referenda

Technical Fellowship votes on the Collectives chain

Polkadot
Fellowship #210ApprovedFellows

Approve referendum 1172

Proposer
Who votes
Fellow (rank 3) and above
Ended
22 Sept 2024
Comments
1

Description

Written by the proposer, as published on Subsquare

On chain

Origin
-
Track
Fellows (#3)
Proposal
lookup 0xde90627b235f75f1886461359f6ecd575ad223fc40632cc58892b7e978a32c2a (53 bytes)
Decision deposit
bkchr
Submitted
Collectives block 4,681,728 · 19 Sept 2024, 18:46 UTC

Discussion

1 comments from Subsquare; spam hidden

eskimor804d 9h ago

Approving. Checked the correctness via the following procedure (on top of verifying that this referendum is whitelisting what it should be whitelisting):

This referendum is whitelisting this proposal.

I decoded the call that is sent to the coretime chain

"0x000404804dcb50595177a3177648411a42aca0f5105ad1cd2cda4c983ad52e885a7f9c78e45c4f0200c089010000e876481700000000000000000000004d630400fd7604000500050033000100e876481700000000000000000000000000" via polkadot js extrinsics - decode into the actual set_storage value that gets executed on the Coretime chain.

It is: system.setStorage with key: 0x4dcb50595177a3177648411a42aca0f5105ad1cd2cda4c983ad52e885a7f9c78 value: 0x5c4f0200c089010000e876481700000000000000000000004d630400fd7604000500050033000100e876481700000000000000000000000000

This is supposed to correct the end_price and sellout_price in SaleInfo. I verified by checking the code that these are indeed the only places that need fixing.

I checked the storage key to match the one of SaleInfo.

I did so again via polkadot js. Using developer - chain state - selecting broker - saleInfo. It shows the encoded storage key: 0x4dcb50595177a3177648411a42aca0f5105ad1cd2cda4c983ad52e885a7f9c78

which matches the one given in the setStorage call above.

Check the actual value.

For this I wrote the following test:

	#[test]
	fn encode_sale_info_record() {
		let mut record = SaleInfoRecord {
			sale_start: 151_388u32,
			leadin_length: 100_800u32,
			end_price: 10u128,
			region_begin: 287_565u32,
			region_end: 292_605u32,
			ideal_cores_sold: 5u16,
			cores_offered: 5u16,
			first_core: 51u16,
			sellout_price: Some(10u128),
			cores_sold: 0u16,
		};
		println!("Encoded:");
		for b in record.encode() {
			print!("{:0x}", b);
		}
		// value found in state via polkadot js (raw storage): https://polkadot.js.org/apps/#/chainstate/raw
		let in_storage = [ 0x5c, 0x4f, 0x02, 0x00, 0xc0, 0x89, 0x01, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x63, 0x04, 0x00, 0xfd, 0x76, 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x33, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ];
		assert_eq!(record.encode(), in_storage);

		// Now let's check the value actually set:

        // 10 DOT end price based on units here: https://github.com/polkadot-fellows/runtimes/blob/b52f7de0ec77eaa0b70c09b8b8e9643dd34a2829/relay/polkadot/constants/src/lib.rs#L30
		record.end_price = 10*10_000_000_000;
		record.sellout_price = Some(record.end_price);

		// Value retrieved by decoding double encoded xcm: 0x000404804dcb50595177a3177648411a42aca0f5105ad1cd2cda4c983ad52e885a7f9c78e45c4f0200c089010000e876481700000000000000000000004d630400fd7604000500050033000100e876481700000000000000000000000000
		// via polkadot js - extrinsics - decode
		let set_storage_value = [
			0x5c, 0x4f, 0x02, 0x00, 0xc0, 0x89, 0x01, 0x00, 0x00, 0xe8, 0x76, 0x48, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x63, 0x04, 0x00, 0xfd, 0x76, 0x04, 0x00, 0x05, 0x00, 0x05, 0x00, 0x33, 0x00, 0x01, 0x00, 0xe8, 0x76, 0x48, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		];

		assert_eq!(record.encode(), set_storage_value);

	}

It sanity checks that the value in storage (polkadot js - developer tools - chain state - raw storage) is the same I get when encoding SaleInfo with the current values. (I also sanity checked all values once more.) Then I am changing end_price and sell_out_price to the desired value and compare the encoding with the value of the setStorage call. It matches indeed.

What I did not verify: That the actual sent XCM is fully correct, although it does look like it. E.g. the provided paraid 1005 is indeed the coretime chain.

Tally

Final tally

Aye 100.0%Nay 0.0%
56 weighted votes · 12 aye voters of 20 eligible

Voters

12 members voted; weight by rank

Timeline

  1. Submitted19 Sept 2024, 18:46 UTC
  2. DecisionDepositPlaced19 Sept 2024, 18:47 UTC
  3. DecisionStarted19 Sept 2024, 19:19 UTC
  4. ConfirmStarted22 Sept 2024, 20:25 UTC
  5. Confirmed22 Sept 2024, 20:58 UTC
  6. Executed22 Sept 2024, 21:03 UTC