Commit Graph

657 Commits

Author SHA1 Message Date
Cecile Tonglet dd5b344274 Update polkadot and substrate (#71) 2020-03-11 17:45:44 +01:00
Stefanie Doll f29b94816c Add Github Action for Matrix release bot (#69)
This action will publish all pre-released, edited and published releases to a dedicated release notes Matrix room using https://github.com/marketplace/actions/matrix-message

@s3krit already added the necessary secrets to the repository settings.
2020-03-03 22:12:56 +01:00
Cecile Tonglet f8631d8dd5 Run polkadot using future (#63)
Fixes #56 and #44
2020-02-27 17:54:52 +01:00
Bastian Köcher 41817628b7 Update Polkadot/Substrate (#68)
* Update Polkadot/Substrate

* Update branch
2020-02-24 21:52:49 +01:00
Peter Goodspeed-Niklaus 28ad9997ea Automatic Example Collator (#67)
* add polkadot build script

* Add scripting to bring up a simple alice-bob example net

Demonstrated to produce blocks, but as of right now there's still
trouble getting it to respond to external queries on its ports.

* enable external rpc access to the nodes

Also shrink the build context by excluding some extraneous data.

* Ensure external RPC access works

Also set default branch appropriately, and have the stop command
clean itself up more thoroughly.

* Add multi-stage dockerfile for building the cumulus-test-parachain-collator

- Exclude the docker/ directory from build context because we're
  never going to build recursively, and this prevents spurious
  cache misses
- build the parachain collator in three stages. The build stage
  is discarded; the collator stage has a wrapper script to simplify
  generating the right bootnodes flags, and the default stage
  has just the binary in a small runtime.
- build_collator.sh collects appropriate build flags for the dockerfile
- inject_bootnodes.sh discovers the testnet node IDs and inserts them
  into the arguments list for cumulus-test-parachain-collator

* Add services which generate genesis state, run the collator

- Ignore the scripts directory to reduce spurious cache misses.
- Move inject_bootnodes.sh from the scripts directory into the root:
  It can't stay in the scripts directory, because that's ignored;
  I didn't want to invent _another_ top-level subdirectory for it.
  That decision could certainly be appealed, though.
- Move docker-compose.yml, add dc.sh, modify *_collator.sh: by
  taking docker-compose.yml out of the root directory, we can
  further reduce cache misses. However, docker-compose normally
  has a strong expectation that docker-compose.yml exist in the
  project root; it takes a moderately complicated invocation to
  override that expectation. That override is encoded in dc.sh;
  the updates to the other scripts are just to use the override.

The expectation as of now is that scripts/run_collator.sh runs
both chain nodes and the collator, generates the genesis state
into a volume with a transient container, and runs the collator
as specified in the repo README.

Upcoming work: Steps 5 and 6 from the readme.

* Launch the collator node

The biggest change here is adding the testing_net network to the
collator node's networks list. This lets it successfully connect
to the alice and bob nodes, which in turn lets it get their node IDs,
which was the blocker for a long time.

Remove httpie in favor of curl: makes for a smaller docker image,
and has fewer weird failure modes within docker.

Unfortunately this doesn't yet actually connect to the relay chain
nodes; that's the next area to figure out.

* enable external websocket access to indexer nodes

* Reorganize for improved caching, again

- Manually enumerate the set of source directories to copy when building.
  This bloats the cache a bit, but means that rebuilds on script changes
  don't bust that cache, which saves a _lot_ of time.
- Un-.dockerignore the scripts directory; it's small and will no longer
  trigger cache misses.
- Move inject_bootnodes.sh back into scripts directory for better organization.
- inject_bootnodes.sh: use rpc port for rpc call and p2p port for
  generating the bootnode string. I'm not 100% sure this is correct,
  but upwards of 80% at least.
- docker-compose.yml: reorganize the launch commands such that alice
  and bob still present the same external port mapping to the world,
  but within the docker-compose network, they both use the same
  (standard) p2p, rpc, and websocket ports. This makes life easier
  for inject_bootnodes.sh

The collator node still doesn't actually connect, but I think this
commit still represents real progress in that direction.

* Get the collator talking to the indexer nodes

In the end, it was four characters: -- and two = signs in the
launch arguments. They turn out to be critical characters for
correct operation, though!

Next up: automating step 5.

* Add runtime stage to collect runtime wasm blob into volume

We can't just copy the blob in the builder stage because the volumes
aren't available at that point.

Rewrite build_collator.sh into build_docker.sh and update for generality.

* WIP: add registrar service and partial work to actually register the collator

This is likely to be discarded; the Python library in use is 3rd party
and not well documented, while the official polkadot-js repo has a
CLI tool: https://github.com/polkadot-js/tools/tree/master/packages/api-cli

* Add a parachain registrar which should properly register the parachain

Doesn't work at the moment because it depends on two api-cli features
which I added today, which have not yet made it out into a published
release.

Next up: figure out how to add the `api-cli` at its `master` branch,
then run tests to ensure the collator is producing blocks. Then,
automate the block production tests.

* BROKEN attempt to demo registrar communication with the blockchain

This is a really weird bug. After running `scripts/run_collector.sh`,
which brings everything up, it's perfectly possible to get into
a state very much like what the registrar is in, and communicate
with the blockchain without issue:

```sh
$ docker run --rm --net cumulus_testing_net para-reg:latest polkadot-js-api --ws ws://172.28.1.1:9944 query.sudo.key
Thu 20 Feb 2020 12:19:20 PM CET
{
  "key": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
}
```

However, the registrar itself, doing the same thing from within
`register_para.sh`, is failing to find the right place in the network:

```
/runtime/cumulus_test_parachain_runtime.compact.wasm found after 0 seconds
/genesis/genesis-state found after 0 seconds
2020-02-20 10:43:22          API-WS: disconnected from ws://172.28.1.1:9944 code: '1006' reason: 'connection failed'
_Event {
  type: 'error',
  isTrusted: false,
  _yaeti: true,
  target: W3CWebSocket {
    _listeners: {},
    addEventListener: [Function: _addEventListener],
    removeEventListener: [Function: _removeEventListener],
    dispatchEvent: [Function: _dispatchEvent],
    _url: 'ws://172.28.1.1:9944',
    _readyState: 3,
    _protocol: undefined,
    _extensions: '',
    _bufferedAmount: 0,
    _binaryType: 'arraybuffer',
    _connection: undefined,
    _client: WebSocketClient {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      config: [Object],
      _req: null,
      protocols: [],
      origin: undefined,
      url: [Url],
      secure: false,
      base64nonce: 'aJ6J3pYDz8l5owVWHGbzHg==',
      [Symbol(kCapture)]: false
    },
    onclose: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onmessage: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  cancelable: true,
  stopImmediatePropagation: [Function (anonymous)]
}
```

They should be connected to the same network, running the same
image, doing the same call. The only difference is the file
existence checks, which really shouldn't be affecting the network
state at all.

Pushing this commit to ask for outside opinions on it, because
this is very weird and I clearly don't understand some part of
what's happening.

* Fix broken parachain registrar

The problem was that the registrar container was coming up too fast,
so the Alice node wasn't yet ready to receive connections. Using
a well-known wait script fixes the issue.

Next up: verify that the collator is in fact building blocks.

* fixes which cause the collator to correctly produce new parachain blocks

It didn't take much! The biggest issue was that the genesis state
was previously being double-encoded.

* add documentation for running the parachain automatically

* Add health check to collator

* minor scripting improvements

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Docker: copy the whole workspace in one go

Pro: future-proofing against the time we add or remove a directory
Con: changing any file in the workspace busts Rust's build cache,
     which takes a long time.

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-21 16:20:22 +01:00
Bastian Köcher 3ab7998909 Update README.md (#66) 2020-02-20 09:23:02 +01:00
Cecile Tonglet e13511bd8a Fix: relay chain arguments need a first argument "command" (#65)
Otherwise the first positional argument is just swallowed

Fixes #62

Forked at: cd1eb3786d
Parent branch: origin/master
2020-02-18 15:22:40 +01:00
Bastian Köcher cd1eb3786d Remove unwrap_trie_error and replace with expect (#64) 2020-02-18 12:25:11 +01:00
Bastian Köcher 0d83b55741 Update README to fix the startup (#61)
* Update README to fix the startup

* Add missing `=`

* Apply suggestions from code review
2020-02-14 22:03:11 +01:00
Bastian Köcher 0c3fb0dde7 Update Polkadot chain-spec and switch to new wasm builder (#60) 2020-02-14 11:44:27 +01:00
Cecile Tonglet ea65c31654 Disable mdns polkadot (#58)
Deactivate mdns for polkadot node as it prevents the process to exit properly

Fixes #57
2020-02-11 13:11:21 +01:00
Cecile Tonglet e880fe43e9 Update polkadot & substrate (#55) 2020-02-10 18:01:59 +01:00
Cecile Tonglet 2941569e8a Update CLI (#53)
* Initial commit

Forked at: 0efd15c0c5
Parent branch: master

* Update substrate: more CLI improvement

* Update substrate and polkadot to cecton-cumulus-branch

* WIP

Forked at: 0efd15c0c5
Parent branch: master

* Update Cargo.lock

* WIP

Forked at: 0efd15c0c5
Parent branch: master

* WIP

Forked at: 0efd15c0c5
Parent branch: master

* Update Cargo.lock

* WIP

Forked at: 0efd15c0c5
Parent branch: master

* WIP

Forked at: 0efd15c0c5
Parent branch: master

* Test running node and interrupts

* WIP

Forked at: 0efd15c0c5
Parent branch: master

* Update Cargo.lock

* Update test/parachain/tests/running_the_node_and_interrupt.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-10 12:39:32 +01:00
Cecile Tonglet 0efd15c0c5 Update substrate and polkadot (#50)
* Update Cargo.lock

* Fix for substrate update

* Update Cargo.lock

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Update Cargo.lock

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* WIP

* Temporary fix until polkadot is fixed

* WIP

* WIP
2020-02-03 15:39:51 +01:00
Joshy Orndorff 539f83efbf Minor fix to readme instructions (#51) 2020-02-03 09:36:33 +01:00
Cecile Tonglet 7fb8b2fb47 Update substrate async api (#49)
* Update substrate: async API fix

* Fix to update polkadot and substrate

* Update substrate & polkadot to use cumulus-branch

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-02-01 16:28:33 +01:00
Cecile Tonglet a7d2700b99 Splitting relaychain and parachain command-line arguments (#42)
Fixes #34

Added .editorconfig
2020-01-28 10:00:45 +01:00
Bastian Köcher 3f4c51f14c Update chainspec to make the test parachain work again (#47) 2020-01-22 11:29:57 +01:00
Bastian Köcher 704b25d123 Fix missing keystore config in test collator (#46) 2020-01-21 13:44:56 +01:00
Bastian Köcher 4b2cdb6c14 Update the README (#45) 2020-01-20 13:13:36 +01:00
Ashley 4d47510e0a asyncify the big collator future (#40)
* Rewrite collator future

* Add future to tests
2020-01-16 17:28:58 +01:00
Bastian Köcher 765a38932f Update Substrate & Polkadot (#41) 2020-01-16 17:26:49 +01:00
Bastian Köcher 6a04f4dbf7 Merge pull request #39 from paritytech/bkchr-safety-violation
Don't finalize the same block multiple times
2020-01-16 08:43:53 +01:00
Bastian Köcher f0baba94fb Don't finalize the same block multiple times
This fixes the `Safety violation:...` logging.
2020-01-15 16:59:23 +01:00
Bastian Köcher dcde10c918 Merge pull request #33 from paritytech/bkchr-make-it-work-again
Make everything compile and fix tests
2020-01-15 12:22:37 +01:00
Bastian Köcher 307fbdc931 Overwrite more storage functions 2020-01-15 11:39:27 +01:00
Bastian Köcher 1bcb147669 Make everything compile and fix tests 2020-01-14 22:23:16 +01:00
Bastian Köcher e115da25e6 Merge pull request #32 from paritytech/CI_optimizations
CI optimizations
2019-12-08 14:31:46 +01:00
Denis P 7052a10bf1 CI optomizations 2019-12-06 10:13:21 +01:00
Bastian Köcher f9a7199b65 Merge pull request #29 from paritytech/joshy-clarify-instructions
Clarify instructions for registering a parachain.
2019-11-30 11:37:57 +01:00
Joshy Orndorff 84f522984c Clarify instructions for registering a parachain. 2019-11-29 16:48:44 -05:00
Bastian Köcher e025dabe76 Merge pull request #17 from paritytech/gui-candidate-justification
implementation of BlockAnnounceValidator
2019-11-06 09:49:58 +01:00
Bastian Köcher 76d304677d Merge branch 'master' into gui-candidate-justification 2019-11-06 09:16:38 +01:00
Bastian Köcher d0f855b246 Merge pull request #22 from paritytech/bkchr-test-parachain
Add test parachain
2019-11-06 09:15:12 +01:00
Bastian Köcher 74cb79687c Fixes tests 2019-11-06 09:00:29 +01:00
thiolliere 997b02d8e6 allow empty data 2019-10-31 15:31:42 +01:00
thiolliere 647d376a4f improve doc 2019-10-31 15:28:16 +01:00
thiolliere 6cf27d9e97 use gossip message directly 2019-10-31 15:22:14 +01:00
Bastian Köcher b1df91dafe Merge pull request #21 from paritytech/retry_on_gitlab_system_failures
retry on gitlab system failures
2019-10-31 09:26:46 +01:00
Bastian Köcher debf9a2b95 Update .gitlab-ci.yml 2019-10-31 09:25:50 +01:00
Denis P b1b0eaa108 retry on gitlab system failures 2019-10-30 18:28:55 +01:00
thiolliere 83d2425eaf copyright 2019-10-24 13:52:10 +02:00
thiolliere fb44a0e5e0 refactor 2019-10-24 13:47:06 +02:00
thiolliere 280c89f149 doc 2019-10-24 13:44:05 +02:00
thiolliere 05249cac55 code moved 2019-10-24 13:41:58 +02:00
Bastian Köcher 535be44e8e Add instructions to the README 2019-10-22 17:02:16 +02:00
Bastian Köcher 0edc170036 The parachain does not need any bootnodes for now 2019-10-22 16:41:13 +02:00
thiolliere 712a2a1580 Fix inconsistent head_data (#18)
* fix

* Update consensus/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-10-22 15:26:35 +02:00
Bastian Köcher d3ed1df0ea Implement block import 2019-10-22 15:26:11 +02:00
Bastian Köcher 451d92affa Fix proof generation and make validate block return the correct result 2019-10-22 14:46:27 +02:00