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

Dedicated Parachain Runtime #198

Merged
merged 24 commits into from
Apr 2, 2024
Merged

Conversation

JoshOrndorff
Copy link
Contributor

@JoshOrndorff JoshOrndorff commented Mar 21, 2024

Closes #116. Second try after #150.

This PR introduces a dedicated parachain runtime instead of having a parachain feature in the existing runtime.

This solves a problem that when you simply ran cargo build --release in the repo, it would build the runtime with the parachain feature which meant the sovereign node would be broken.

But don't worry! This does not bring back (much) code duplication. We are able to take the sovereign runtime's constraint checker and use it as a constituent piece in the parachain's checker. This is all thanks to out aggregation macro's focus on recursion.

I included some comments to flex that our design is nicer than FRAME's in this regard.

The wallet also has some changes to support this.

  1. The uses opaque blocks for much more of its processing, and only decodes the transactions when dealing with individual piece logic. This is good and probably should have been the case all along.
  2. It now supports encoding to either the standalone or parachain node via the --parachain flag. This paves the way to start experimenting with metadata (Metadata #30).

@JoshOrndorff
Copy link
Contributor Author

An alternate approach to keeping the wallet compatible with both runtimes would be to do a layer of dummy wrapping directly in the regular template runtime.

@JoshOrndorff

This comment was marked as outdated.

@JoshOrndorff JoshOrndorff marked this pull request as ready for review March 23, 2024 16:38
@JoshOrndorff

This comment was marked as resolved.

Comment on lines +24 to +26
#[arg(long, short('d'))]
/// Path where the wallet data is stored. Default value is platform specific.
pub path: Option<PathBuf>,
pub base_path: Option<PathBuf>,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wallet now uses the same long and short flag as the node itself, and this frees up -p for the new --parachain flag.

@JoshOrndorff JoshOrndorff force-pushed the joshy-dedicated-parachain-runtime-2 branch from 1c72a85 to 94f63b9 Compare April 2, 2024 17:21
Copy link

github-actions bot commented Apr 2, 2024

Coverage after merging joshy-dedicated-parachain-runtime-2 into main will be

59.72%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tuxedo-core/aggregator/src
   lib.rs99.14%100%100%99.11%201, 22, 84
tuxedo-core/no_bound/src
   clone_no_bound.rs36.63%100%30%37.36%24, 32–39, 56, 59–72, 74–87, 89, 91–95, 98–99
   debug_no_bound.rs32.73%100%30%33%101–105, 108–109, 24, 32–42, 58, 60–78, 80–95, 97–99
   default_no_bound.rs19.11%100%16.67%19.31%100–122, 124–131, 133, 136–147, 151–157, 32–39, 51, 54–80, 83–88, 91–99
   lib.rs100%100%100%100%
tuxedo-core/src
   constraint_checker.rs45.16%100%40%46.15%118–126, 132–137, 139–148, 150, 169, 198–202, 205–210, 213–214
   dynamic_typing.rs92.11%100%75%95.31%56
   executive.rs91.73%100%91.49%91.75%127, 153, 193, 225, 254, 265, 316, 343, 394–399, 401, 411–412, 417–418, 420, 423–424, 427, 429–430, 433–434, 436, 440–461, 463, 467–468, 470–471, 473, 476–493, 55, 98
   genesis.rs44.55%100%50%44.21%102–103, 106, 158–160, 169, 36–49, 60, 62–65, 67–68, 70–72, 75–79, 81–83, 85–96, 98–99
   inherents.rs15.94%100%23.53%14.88%122–124, 135, 151–158, 165–179, 185–203, 205–235, 56–58, 65–70, 72–80, 83, 85
   types.rs61.78%100%31.03%68.75%12, 142, 156, 158, 160, 193, 200–205, 35, 82–86, 88–91, 93–99
   utxo_set.rs90.91%100%100%88.89%39–40
   verifier.rs51.52%100%35.29%57.14%106–108, 43–44, 46, 48–49, 54, 71, 78–80, 82–84, 92
tuxedo-core/src/verifier
   htlc.rs88.93%100%56.25%93%107, 109, 115, 40, 55, 74–78, 91
   multi_signature.rs92.79%100%79.17%94.44%100–105, 21, 45, 71
   simple_signature.rs83.78%100%61.11%88.17%32, 65, 78–82
tuxedo-parachain-core/register_validate_block/src
   lib.rs38.75%100%100%36.36%100–125, 14, 16, 39–42, 56, 66, 85–99
tuxedo-parachain-core/src
   collation_api.rs0%100%0%0%19–40
   lib.rs34.48%100%33.33%35%138, 85–90, 94–96
   relay_state_snapshot.rs0%100%0%0%128–140, 147–155, 157, 173–188, 193–202, 204–211, 223, 225, 227–233, 235–240, 242, 245–250, 252–257, 259–271, 274–286, 292–298, 303–310, 316–323, 330–337, 346–354, 362–370, 378–383, 389–394, 41, 54
   tests.rs100%100%100%100%
tuxedo-parachain-runtime/src
   genesis.rs0%100%0%0%20–51
   lib.rs0%100%0%0%104, 109, 118–139, 142–169, 172–290, 60–65, 96–97, 99
tuxedo-template-runtime/src
   genesis.rs84.42%100%85.71%84.35%23–45
   lib.rs3.40%100%10.34%2.03%100–104, 118, 122, 127–129, 133–135, 145, 148, 150, 152, 154, 156, 158, 160, 162, 165, 167, 172, 181–188, 193, 202–223, 226–253, 256–367, 63–68, 99
wallet/src
   amoeba.rs0%100%0%0%100–117, 120–121, 123–129, 131–138, 20–22, 24, 26, 28–59, 62–63, 65–99
   cli.rs0%100%0%0%104, 123, 129, 137, 148, 154, 20, 22, 31, 36, 41, 45, 69, 81
   keystore.rs0%100%0%0%30–33, 38–45, 47–48, 51, 53–59, 65–73, 76–78, 80–82, 85–91, 93–94
   main.rs0%100%0%0%100–212, 215–222, 225–228, 230–232, 235–237, 239, 241, 244–250, 253–266, 269–272, 274–279, 28, 280–285, 287, 29–99
   money.rs0%100%0%0%100–101, 104–122, 126–132, 138–145, 147, 151–156, 160, 163, 165, 168–171, 173–174, 178, 182–187, 192–198, 200–204, 207–208, 212–217, 219–220, 223–229, 23, 230–234, 236, 238, 24–29, 31, 33, 35–39, 41–56, 58–59, 63–76, 79–89, 91, 93, 95–99
   output_filter.rs100%100%100%100%
   parachain.rs0%100%0%0%16, 18–19, 25–32, 37–39
   rpc.rs0%100%0%0%16–21, 24–29, 31–39, 42–48, 50–53, 55–56
   sync.rs0%100%0%0%100–107, 109, 111, 116–121, 125–128, 135–136, 138, 141–144, 149–151, 154–155, 158–163, 165–167, 170, 172–173, 178–181, 184–185, 192–196, 198–204, 207–209, 211–212, 215–216, 221–224, 227, 229–230, 235–238, 241, 243–244, 247–253, 255–256, 259–260, 263–264, 267–268, 272–279, 282, 285–289, 292, 294, 297, 299, 303, 305–306, 309–310, 313–320, 322–323, 326–327, 329, 331–332, 336–338, 340–341, 343–344, 346–347, 350–352, 354–355, 357–358, 360–361, 365, 367, 370–371, 375, 377–382, 385–386, 389–391, 394, 397–400, 402, 405–408, 411, 414–415, 418–419, 424–429, 431, 433, 438–441, 444–445, 448–453, 455, 458–459, 463–464, 466, 468–470, 472–475, 478–479,

@JoshOrndorff JoshOrndorff merged commit 16906d1 into main Apr 2, 2024
6 checks passed
@JoshOrndorff JoshOrndorff deleted the joshy-dedicated-parachain-runtime-2 branch April 2, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

POC Recursive tuxedo piece aggregation
1 participant