Skip to content

Instantly share code, notes, and snippets.

@MiloDavis
Created April 12, 2018 18:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiloDavis/6a0b57aeebd893d9b3c92b0a415ab552 to your computer and use it in GitHub Desktop.
Save MiloDavis/6a0b57aeebd893d9b3c92b0a415ab552 to your computer and use it in GitHub Desktop.

Did you miss me last week? If you did, here's a larger update on the current MRs to make up for it. If you did not, this frog perfectly represents my feelings about that.

Remove Prevalidation Block Previously in the Tezos client and node, there was a concept of a "prevalidation" context. This context was a special, fake block that included all of the operations that you had submitted, but hadn't been validated. This was nice in some ways, but also could lead to issues with consistency and it was difficult to understand what was being controlled and how. This MR also forces some changes to testing code. Tests that originate contracts or make transactions must now bake a block afterwards. This ensures that the blockchain is actually updated.

Previously, you could use the prevalidation block to create larger sequences of operations, however Tezos actually has a better answer for this than assuming that a series of initializations/transfers will happen in sequence: macro transactions. If you look at the Tezos block structure, the operations field of a block is a list of lists. This is because you can submit operations in Tezos that sequences. These sequences are included in a block atomically, and the primitive operations they consist of are executed in sequence.

Client: wait for operation inclusion command and RPC It's sometimes important to wait to see if an operation has been included in the blockchain without resorting to using a block explorer. To this end, there are a few new RPCs and a new command that allow you to have the block explorer wait for a specified number of confirmations after your operation has been included in a block.

Tests add context This MR is part of the ongoing effort to add more tests to Tezos. It adds new functionality to the incremental type, which can be used to build blocks one piece at a time during tests.

Proto/Env: replace `configuresandbox` by proper `init` function The largest change made in this MR is to change how the node is initialized. Previously, there was a configure_sandbox function, which deactivated the external p2p layer and made certain changes to the way the node worked, which stopped it from broadcasting your changes to the network. This mode still exists, but it has been folded into the init code for the node. This has also changed how some of the data handling works.

This MR does a few additional things.

  • It updates Jbuilder to beta 19.1.
  • It adds a script to generate the prefixes for base58 encodings. The tz1 and TZ1 are not coincidental. There were magic numbers found that, when added, give nice hashes. This script helps automate the process of finding these numbers.
  • It refactors the Ed25519 module, moving some things into new submodules.

Node,State,Chain: Randomize compute locator When two nodes sync, they exchange locator information. This information is a sequence of block hashes, which they use to determine what data they need and what data they already have. This change adds randomness to decide what data is exchanged. The randomness is deterministic based on the function's arguments, so though two different other nodes may receive different information, this function can be tested.

Test: minor improvements to testlib.inc.sh This MR is super minor, but I'm going to talk about it because the script it modifies is useful if you want to write tests for Michelson contracts. Let's say that you're writing a contract that's going to store a bunch of your money. You should definitely write tests, like a lot of them. This script provides a nice way of launching a node, and a variety of bash procedures that let you write testing scripts. So, if you're writing Michelson test scripts, consider using these primitives.

Dataencoding: be compatible with 32bits platform. This MR makes the Data_encoding library work on 32 bit platforms. It adds types like the uint30, which is a 30 bit unsigned integer. This type is useful because OCaml uses 31 bit integers on 32 bit platforms, which can't represent unsigned integers greater than 30 bits. This type is useful if you want to guarantee that a number will be unsigned. This changes some of the ways that the ranged integers work. They will no longer support ranges greater than the 31 bit integer range.

Alpha/Tests: constants This MR changes how non-context-based constants are stored. It also adds a convenient RPC to get those values.

Client: fix error when signing with encrypted keys This MR stops an error from occurring when using encrypted keys. This error had to do with how keys are referenced once they are stored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment