From d5ad81be5df8c2e819415623f31a725fd5c43ddc Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Fri, 28 Jun 2024 15:46:57 -0400 Subject: [PATCH 01/16] Process downloaded glossary --- .github/workflows/deploy-production.yml | 1 + .github/workflows/deploy-staging.yml | 1 + docs/overview/glossary.md | 369 +------------------- package-lock.json | 384 +++++++++++++++++++++ package.json | 4 +- src/css/custom.css | 4 + src/scripts/downloaded_glossary.html | 347 +++++++++++++++++++ src/scripts/process_downloaded_glossary.js | 52 +++ 8 files changed, 794 insertions(+), 368 deletions(-) create mode 100644 src/scripts/downloaded_glossary.html create mode 100644 src/scripts/process_downloaded_glossary.js diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 447a06942..3a1a01746 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -18,6 +18,7 @@ jobs: with: node-version: 18 - run: npm ci + - run: npm run glossary - run: npm run build - uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index f41a80fab..9fe18234b 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -18,6 +18,7 @@ jobs: with: node-version: 18 - run: npm ci + - run: npm run glossary - run: BUILD_ENV=staging npm run build - uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/docs/overview/glossary.md b/docs/overview/glossary.md index cc0f10bc3..9c8031bfd 100644 --- a/docs/overview/glossary.md +++ b/docs/overview/glossary.md @@ -1,372 +1,7 @@ --- title: Glossary -last_update: - date: 24 October 2023 --- -## Tezos and tez + -The following is adapted from this [Agora post](https://forum.tezosagora.org/t/nomenclature/2376) by Tezos Co-founder Arthur Breitman. As noted in the post, there is no official body that can authoritatively set Tezos' nomenclature, but the following is recommended: - -### Tezos - - Used either as a noun or an adjective to designate: - - * An open-source project and software (as in, "contributing to the Tezos codebase") - * A peer-to-peer network of nodes maintaining a blockchain (as in "a Tezos node") - * The specific Tezos chain with the most economic relevance (as in "the Tezos chain"). In particular, the chain whose [millionth block](https://tzkt.io/BKtC4QCWoF73kxLj773vFpQuuwrnye6PS7T1aM3XEPvFXiQbNu7/endorsements) had hash `BKtC4QCWoF73kxLj773vFpQuuwrnye6PS7T1aM3XEPvFXiQbNu7`. - -### Tez - - A unit of the cryptocurrency native to a Tezos chain, such as in "I sent you 2 tez." Tez is invariable. It is not capitalized except at the beginning of a sentence or when you would otherwise capitalize a noun. "I sent you 2 tez" and not "2 Tez". - -### XTZ - - XTZ, tez, or ꜩ (`\ua729`, "Latin small letter tz") is the native currency of Tezos. - - "XTZ" is an ISO-4217-compatible code for representing tez on the most economically relevant Tezos chain. Unless there is a very specific reason to use an ISO code for it, the term tez is preferred. Situations where the ISO code might be useful typically involve accounting systems, exchange rates with other currencies, and anything that might need some sort of standardized code. - - - -## Tezos terms - -### Block - - The Tezos blockchain is a linked list of blocks (or actually, a tree when several competing branches exist). - Blocks conceptually contain a header and a list of operations, - which are specific to the economic protocol. - - The header itself decomposes into a shell header (common to all Tezos economic protocols), and a protocol-specific header. - The shell header contains protocol-agnostic data such as the predecessor's block hash and the block's timestamp. - -### Context - - The state of the blockchain. The context is defined by the - economic protocol and typically includes information such as - "this account is credited with this many tez" and "this is the - code for that smart contract." - - The context is modified by operations. For example, an - operation can transfer tez from one account to another, which modifies the - part of the context that tracks account credit. - -### Economic protocol - - The economic protocol is the set of rules defining valid operations and blocks, how the network agrees on the next block to build (the consensus algorithm), - and how operations update the blockchain state, also called context. - - In Tezos, the economic protocol can be upgraded without interruption or - forking of the blockchain. This is because the procedure for an upgrade is also defined within the economic protocol, which can thus update itself. - -### Fitness - - (a.k.a. score, weight) - For each block, the consensus algorithm can compute a score called fitness which determines the quality of the chain leading to that block. - The shell changes the head of the chain to the valid block that has the highest fitness. - -### Height - - See level. - -### Level - - (a.k.a. block height) - The position of a block in the blockchain, that is, the number of blocks - since the genesis block, where the genesis block is at level 0. - -### Mempool - - A (block or operation) metadata is a piece of data - computed as a result of the application of the - block or operation on an associated context. The metadata - consists of many pieces of information such as the operation receipts, - rewards updates, voting period, etc. - - A block's metadata is the collections of operations metadata for all the operations included in the block (if the validation was successful). - -### Node - - A peer in the P2P network. It maintains a local state and propagates blocks - and operations. - -### Operation - - An operation transforms the context; this is what makes the state of the chain - change. Operations are grouped into blocks; thus, the chain progresses in - batches. - -### Score - - See fitness. - -### Shell - - The shell is a software component of the node. It is parameterized by a - specific economic protocol. It serves as the bridge between the P2P layer - (handling communication between nodes) and the economic protocol layer - (handling the context, operation application, scoring, etc.). - -### Weight - - See fitness. - -## Protocol terms - -### Accuser - - When a delegate attempts double signing (or when it tries - to abuse the network in another similar way), another delegate can make an - accusation, by providing evidence of the offense. The delegate injecting the accusation in a newly baked block is called the accuser. - - The accuser is awarded some funds from the security deposit of the accused. - - When using Octez, accusation operations are emitted by the - accuser daemon. Note that this daemon is not associated to a delegate: accusation operations are anonymous, and any delegate can include them in a block. - -### Account - - An account is an address managed by the protocol. - In the context, each account is associated with a balance (an amount of - tez available). - - An account can be a user account or a smart contract. - -### Baker - - When a delegate creates a new block, it is called the baker of this block. - Baking rights are distributed to different delegates based on their - available stake. Only a delegate with baking rights - is allowed to bake. - The baker selects transactions from the mempool to be included in the block it bakes. - - When using Octez, baking and other consensus actions are handled by the baker - daemon, on behalf of one or more delegate accounts. - By extension, a baker designates the owner of such a delegate account, typically running the baker daemon on its behalf. - -### Baking - - The act of creating a new block by a baker. - -### Baking rights - - Baking/endorsing a block can only be done by a delegate who holds the - baking/endorsing right for that block level and round. At the start of a cycle, - baking and endorsing rights are computed for all the block levels and rounds in the - cycle, based on the proportion of the stake of each delegate. - - For each block level and round, there is exactly one account that is allowed to bake, but several accounts are allowed to endorse. - -### Burn - - To ensure responsible use of the storage space on the public blockchain, - there are some costs charged to users for consuming storage. These - costs are burnt (i.e., the amount of tez is destroyed). For example, - a per-byte storage cost is burnt for increasing the storage space of a - smart contract; a fixed amount is burnt for allocating a new contract - (which consumes space by storing its address on the blockchain). - - See also fee. - -### Constant - - Protocols are parameterized by several parameters called protocol constants, which may vary from one protocol to another or from one network to another. - -### Contract - - See account. - -### Cycle - - A cycle is a sequence of consecutive blocks of fixed length (given by a protocol constant). E.g., cycle 12 started at block - level 49152 and ended at block level 53248. - - Cycles are used as a unit of "time" in the block chain. For example, the - different phases in the amendment voting procedures are defined based on - numbers of cycles. - - The length of a cycle is a (parametric) protocol - constant, and thus might change across different - Tezos protocols. - -### Delegate - - A user account that can participate in consensus and in governance. - Actual participation is under further provisions, like having a minimal stake. - A user account becomes a delegate by registering as such. - Through delegation, other accounts can delegate their rights to a delegate account. - The delegate's rights are calculated based on its stake. - Note that `tz4` accounts cannot be delegates. - -### Delegation - - An operation in which an account designates a - delegate. The delegating account's balance increases the delegate's stake and consequently - its baking rights and endorsing rights. However, the delegate does not control the funds of - the delegating account, e.g., it can not spend them. - -### Double signing - - The situation when a baker signs two different blocks at the same level and same round, - is called double baking. Double baking is detrimental to the network and might be - indicative of an attempt to double spend. - The same goes for signing two different endorsements at the same level and the same round. - As such, double signing (i.e., double baking or double endorsing) is punished by the - network: an accuser can provide proof of the double signing to be awarded - part of the double signer's deposit -- see Slashing. - -### Failing Noop - - The `Failingnoop` operation implements a *No-op*, which always - fails at application time, and - should never appear in applied - blocks. This operation allows end-users to - sign arbitrary messages which have no - computational semantics. - -### Endorsing - - When a block is created and propagated on the network, delegates that have - endorsing rights for the matching block level and round can emit an endorsement operation. - Endorsement operations are included in the next block. - -### Endorsing rights - - See baking rights. - -### Fee - - To ensure responsible use of computation resources of other nodes, and also to encourage active participation in the consensus protocol, - users pay fees to bakers for including their operations in blocks. - For example, fees are paid to a baker for operations such as a transaction or a revelation of a public key. - - Currently, only manager operations - require collecting fees from its sender account. - - See also burn. - -### Gas - - A measure of the number of elementary steps performed during - the execution of a smart contract. Gas is used to measure how - much computing power is used to execute a smart contract. - -### Implicit account - - See [User account](#user-account). - -### Layer 1 - - The primary blockchain i.e. the Tezos chain. Within any blockchain ecosystem, Layer 1 (L1) refers to the main chain to - which side chains, rollups, or other protocols connect and settle to. The Layer 1 chain is deemed to be most - secure, since it has the most value (or stake) tied to it, and be most decentralized and censorship resistant. - However, transaction space is limited leading to low throughput and possibly high transaction costs. - See Layer 2. - -### Layer 2 - - Layer 2 (L2) includes sidechains, rollups, payment channels, etc. that batch their transactions and - write to the layer 1 chain. By processing transactions on layer 2 networks, - greater scalability in speed and throughput can be achieved by the ecosystem overall, since the number of transactions - the layer 1 can process directly is limited. By cementing transactions from a L2 to L1, - the security of the L1 chain backs those operations. In Tezos there are a number of layer 2 solutions, - including Smart Optimistic Rollups, - validity or ZK-Rollups [Epoxy](https://research-development.nomadic-labs.com/files/cryptography.html) , - zkChannels, and sidechains such as [Deku](https://deku.marigold.dev/). - -### Michelson - - The built-in language used by a smart contract. - -### Minimal stake - - An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a - delegate to have baking rights and voting rights in a cycle. - -### Operation kinds - - The main kinds of operations in the protocol are transactions (to transfer funds - or to execute smart contracts), accusations, activations, delegations, - endorsements, and originations. - -### Originated account - - See smart contract. - -### Origination - - A manager operation whose purpose is to create -- that - is, to deploy -- a smart contract on the Tezos blockchain. - -### Round - - An attempt to reach consensus on a block at a given level. - A round is represented by an index, starting with 0. - Each round corresponds to a time span. - A baker with baking rights at a given round is only allowed to bake during - the round's corresponding time span. Baking outside of one's designated - round results in an invalid block. - -### Roll - - deprecated; see minimal stake. - -### Smart contract - - Account which is associated to a Michelson script. - They are created with an - explicit origination operation and are therefore sometimes called - originated accounts. The address of a smart contract always starts - with the letters `KT1`. - -### Smart Optimistic Rollups - - Smart optimistic rollups constitute a layer 2 solution that can be used to deploy either a general-purpose polyvalent layer 2 blockchain - (e.g., an EVM-compatible one), or an application-specific DApp. - -### Stake - - The amount of tokens that determines a delegate's weight in the - governance process and in the selection of its baking and - endorsing rights. A delegate's stake is usually given by the - delegate's own tokens plus the sum of tokens delegated to - it. However, there are cases when this is not the case, see - [here](https://tezos.gitlab.io/active/consensus.html#active-stake-nairobi) for details. - -### Transaction - - An operation to transfer tez between two accounts, or to run the code of a - smart contract. - -### User account - - An account that is linked to a public key. Contrary to a smart - contract, a user account cannot include a script and it - cannot reject incoming transactions. - - If *registered*, a user account can act as a delegate. - - The address of a user account always starts with the - letters tz followed by 1, 2, 3, or 4 (depending on the - signature scheme) and finally the hash of the public key. - -### Validation pass - - An index (a natural number) associated with a particular kind of - operations, allowing to group them into classes. Validation passes - enable prioritizing the validation and - application of certain classes of - operations. - -### Voting period - - Any of the `proposal`, `exploration`, `cooldown`, - `promotion` or `adoption` stages in the voting procedure when - amending the economic protocol. - -### Voting listings - - The list calculated at the beginning of each voting period that contains - the staking balance (in number of mutez) of each delegate that owns more - than the minimal stake at that moment. For each delegate, the voting listings - reflect the weight of the vote emitted by the delegate when amending the - economic protocol. \ No newline at end of file +For a glossary of Tezos terms, see [Glossary](https://tezos.gitlab.io/alpha/glossary.html). diff --git a/package-lock.json b/package-lock.json index 22a53fb3a..96a3e1819 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "@docusaurus/module-type-aliases": "3.2.1", "chai": "5.0.0", "glob": "10.3.10", + "jsdom": "^24.1.0", "mdast-util-from-markdown": "2.0.0", "mdast-util-mdx": "3.0.0", "micromark-extension-mdxjs": "3.0.0", @@ -4502,6 +4503,18 @@ "node": ">= 10.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -4709,6 +4722,12 @@ "astring": "bin/astring" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -5503,6 +5522,18 @@ "node": ">=10" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/comma-separated-tokens": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", @@ -6077,6 +6108,24 @@ "node": ">=8.0.0" } }, + "node_modules/cssstyle": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", + "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", + "dev": true, + "dependencies": { + "rrweb-cssom": "^0.6.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cssstyle/node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, "node_modules/csstype": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", @@ -6562,6 +6611,19 @@ "lodash-es": "^4.17.21" } }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/dayjs": { "version": "1.11.10", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", @@ -6595,6 +6657,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, "node_modules/decode-named-character-reference": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", @@ -6745,6 +6813,15 @@ "robust-predicates": "^3.0.0" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -7842,6 +7919,20 @@ "node": ">=6" } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/form-data-encoder": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", @@ -8649,6 +8740,18 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/html-entities": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", @@ -8823,6 +8926,19 @@ "node": ">=8.0.0" } }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/http-proxy-middleware": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", @@ -8869,6 +8985,19 @@ "node": ">=10.19.0" } }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -9237,6 +9366,12 @@ "node": ">=0.10.0" } }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, "node_modules/is-reference": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", @@ -9430,6 +9565,67 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdom": { + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.0.tgz", + "integrity": "sha512-6gpM7pRXCwIOKxX47cgOyvyQDN/Eh0f1MeKySBV2xGdKtqJBLj8P25eY3EVCWo2mglDDzozR2r2MW4T+JiNUZA==", + "dev": true, + "dependencies": { + "cssstyle": "^4.0.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.4", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.10", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.7.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.4", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.17.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -12911,6 +13107,12 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, + "node_modules/nwsapi": { + "version": "2.2.10", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.10.tgz", + "integrity": "sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==", + "dev": true + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -14099,6 +14301,12 @@ "node": ">= 0.10" } }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, "node_modules/punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -14132,6 +14340,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "node_modules/queue": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", @@ -15060,6 +15274,12 @@ "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" }, + "node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==", + "dev": true + }, "node_modules/rtl-detect": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/rtl-detect/-/rtl-detect-1.1.2.tgz", @@ -15149,6 +15369,18 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, "node_modules/scheduler": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", @@ -16020,6 +16252,12 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -16210,6 +16448,60 @@ "node": ">=6" } }, + "node_modules/tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "dev": true, + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tr46/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", @@ -16707,6 +16999,16 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -16819,6 +17121,18 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -16853,6 +17167,15 @@ "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", "integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==" }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/webpack": { "version": "5.89.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz", @@ -17187,6 +17510,52 @@ "node": ">=0.8.0" } }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", + "dev": true, + "dependencies": { + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -17374,6 +17743,21 @@ "xml-js": "bin/cli.js" } }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 5ce291541..c310c2ac8 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", - "test": "mocha" + "test": "mocha", + "glossary": "node ./src/scripts/process_downloaded_glossary.js" }, "dependencies": { "@docusaurus/core": "3.2.1", @@ -36,6 +37,7 @@ "@docusaurus/module-type-aliases": "3.2.1", "chai": "5.0.0", "glob": "10.3.10", + "jsdom": "24.1.0", "mdast-util-from-markdown": "2.0.0", "mdast-util-mdx": "3.0.0", "micromark-extension-mdxjs": "3.0.0", diff --git a/src/css/custom.css b/src/css/custom.css index fb43c4ea9..21ec66513 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -296,3 +296,7 @@ article a[target="_blank"]:after { .language-archetype .token.expr { font-style: italic; } + +.imported-glossary dt { + font-weight: bold; +} diff --git a/src/scripts/downloaded_glossary.html b/src/scripts/downloaded_glossary.html new file mode 100644 index 000000000..fd0d9b74b --- /dev/null +++ b/src/scripts/downloaded_glossary.html @@ -0,0 +1,347 @@ + + + + + + + + Glossary — Tezos (local branch, 2024/06/25 14:19) documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+
+ +
+

Glossary

+

This glossary is divided in two sections, the first one concerns Tezos, and +the second one concerns the economic protocol. The definitions in the latter +section may be different for other protocol versions.

+
+

Tezos

+
+
Block

The Tezos blockchain is a linked list of blocks (or actually, a tree when several competing branches exist). +Blocks conceptually contain a header and a list of operations, +which are specific to the economic protocol.

+

The header itself decomposes into a shell header (common to all Tezos economic protocols), and a protocol-specific header. +The shell header contains protocol-agnostic data such as the predecessor’s block hash and the block’s timestamp.

+
+
+
+
Context

The state of the blockchain. The context is defined by the +economic protocol and typically includes information such as +“this account is credited with this many tez” and “this is the +code for that smart contract.”

+

The context is modified by operations. For example, an +operation can transfer tez from one account to another, which modifies the +part of the context that tracks account credit.

+
+
Economic protocol

The economic protocol is the set of rules defining valid operations and blocks, how the network agrees on the next block to build (the consensus algorithm), +and how operations update the blockchain state, also called context.

+

In Tezos, the economic protocol can be upgraded without interruption or +forking of the blockchain. This is because the procedure for an upgrade is also defined within the economic protocol, which can thus update itself.

+
+
Fitness (a.k.a. score, weight)

For each block, the consensus algotrithm can compute a score called fitness which determines the quality of the chain leading to that block. +The shell changes the head of the chain to the valid block that has the highest fitness.

+
+
Height

See level.

+
+
+
+
Level (a.k.a. block height)

The position of a block in the blockchain, that is, the number of blocks +since the genesis block, where the genesis block is at level 0.

+
+
Mempool

A pool (set) of operations maintained by a node and not yet included in a block.

+
+
+
+
Metadata

A (block or operation) metadata is a piece of data +computed as a result of the application of the +block or operation on an associated context. The metadata +consists of many pieces of information such as the operation receipts, +rewards updates, voting period, etc.

+

A block’s metadata is the collections of operations metadata for all the operations included in the block (if the validation was successful).

+

For a detailed metadata content check the Paris RPCs - Reference under +the prefix ../<block_id>/metadata.

+
+
Node

A peer in the P2P network. It maintains a local state and propagates blocks +and operations.

+
+
Operation

An operation transforms the context; this is what makes the state of the chain +change. Operations are grouped into blocks; thus, the chain progresses in +batches. +For the different kinds of operations defined by the protocol, see operation kinds.

+
+
Score

See fitness.

+
+
Shell

The shell is a software component of the node. It is parameterized by a +specific economic protocol. It serves as the bridge between the P2P layer +(handling communication between nodes) and the economic protocol layer +(handling the context, operation application, scoring, etc.).

+
+
Weight

See fitness.

+
+
+
+
+

Protocol

+
+
Accuser

When a delegate attempts double signing (or when it tries +to abuse the network in another similar way), another delegate can make an +accusation, by providing evidence of the offense. The delegate injecting the accusation in a newly baked block is called the accuser.

+

The accuser is awarded some funds from the security deposit of the accused.

+

When using Octez, accusation operations are emitted by the +accuser daemon. Note that this daemon is not associated to a delegate: accusation operations are anonymous, and any delegate can include them in a block.

+
+
+
+
Account

An account is an address managed by the protocol. +In the context, each account is associated with a balance (an amount of +tez available).

+

An account can be either an originated account or an implicit account.

+
+
Baker

When a delegate creates a new block, it is called the baker of this block. +Baking rights are distributed to different delegates based on their +available stake. Only a delegate with baking rights +is allowed to bake. +The baker selects transactions from the mempool to be included in the block it bakes.

+

When using Octez, baking and other consensus actions are handled by the baker +daemon, on behalf of one or more delegate accounts. +By extension, a baker designates the owner of such a delegate account, typically running the baker daemon on its behalf.

+
+
Baking

The act of creating a new block by a baker.

+
+
Baking rights

Baking/attesting a block can only be done by a delegate who holds the +baking/attesting right for that block level and round. At the start of a cycle, +baking and attesting rights are computed for all the block levels and rounds in the +cycle, based on the proportion of the stake of each delegate.

+

For each block level and round, there is exactly one account that is allowed to bake, but several accounts are allowed to attest.

+
+
Burn

To ensure responsible use of the storage space on the public blockchain, +there are some costs charged to users for consuming storage. These +costs are burnt (i.e., the amount of tez is destroyed). For example, +a per-byte storage cost is burnt for increasing the storage space of a +smart contract; a fixed amount is burnt for allocating a new contract +(which consumes space by storing its address on the blockchain).

+

See also fee.

+
+
Constant

Protocols are parameterized by several parameters called protocol constants, which may vary from one protocol to another or from one network to another.

+
+
Contract

See account.

+
+
+
+
Cycle

A cycle is a sequence of consecutive blocks of fixed length (given by a protocol constant). E.g., cycle 12 started at block +level 49152 and ended at block level 53248.

+

Cycles are used as a unit of “time” in the block chain. For example, the +different phases in the amendment voting procedures are defined based on +numbers of cycles.

+

The length of a cycle is a (parametric) protocol +constant, and thus might change across different +Tezos protocols.

+
+
+
+
Delegate

An implicit account that can participate in consensus and in governance. +Actual participation is under further provisions, like having a minimal stake. +An implicit account becomes a delegate by registering as such. +Through delegation, other accounts can delegate their rights to a delegate account. +The delegate’s rights are calculated based on its stake. +Note that tz4 accounts cannot be delegates.

+
+
Delegation

An operation in which an account designates a +delegate. The delegating account’s balance increases the delegate’s stake and consequently +its baking rights and attesting rights. However, the delegate does not control the funds of +the delegating account, e.g., it can not spend them.

+
+
+
+
Double signing

The situation when a baker signs two different blocks at the same level and same round, +is called double baking. Double baking is detrimental to the network and might be +indicative of an attempt to double spend. +The same goes for signing two different attestations at the same level and the same round. +As such, double signing (i.e., double baking or double attesting) is punished by the +network: an accuser can provide proof of the double signing to be awarded +part of the double signer’s deposit – see Slashing.

+
+
Failing Noop

The Failing_noop operation implements a No-op, which always +fails at application time, and +should never appear in applied +blocks. This operation allows end-users to +sign arbitrary messages which have no +computational semantics.

+
+
Attesting

When a block is created and propagated on the network, delegates that have +attesting rights for the matching block level and round can emit an attestation operation. +Attestation operations are included in the next block.

+
+
Attesting rights

See baking rights.

+
+
+
+
Fee

To ensure responsible use of computation resources of other nodes, and also to encourage active participation in the consensus protocol, +users pay fees to bakers for including their operations in blocks. +For example, fees are paid to a baker for operations such as a transaction or a revelation of a public key.

+

Currently, only manager operations +require collecting fees from its sender account.

+

See also burn.

+
+
+
+
Gas

A measure of the number of elementary steps performed during +the execution of a smart contract. Gas is used to measure how +much computing power is used to execute a smart contract.

+
+
+
+
Implicit account

An account that is linked to a public key. Contrary to a smart +contract, an implicit account cannot include a script and it +cannot reject incoming transactions.

+

If registered, an implicit account can act as a delegate.

+

The address of an implicit account always starts with the +letters tz followed by 1, 2, 3, or 4 (depending on the +signature scheme) and finally the hash of the public key. +See Accounts and addresses for a more detailed explanation on addresses.

+
+
Layer 1

The primary blockchain i.e. the Tezos chain. Within any blockchain ecosystem, Layer 1 (L1) refers to the main chain to +which side chains, rollups, or other protocols connect and settle to. The Layer 1 chain is deemed to be most +secure, since it has the most value (or stake) tied to it, and be most decentralized and censorship resistant. +However, transaction space is limited leading to low throughput and possibly high transaction costs. +See Layer 2.

+
+
Layer 2

Layer 2 (L2) includes sidechains, rollups, payment channels, etc. that batch their transactions and +write to the layer 1 chain. By processing transactions on layer 2 networks, +greater scalability in speed and throughput can be achieved by the ecosystem overall, since the number of transactions +the layer 1 can process directly is limited. By cementing transactions from a L2 to L1, +the security of the L1 chain backs those operations. In Tezos there are a number of layer 2 solutions, +including Smart Optimistic Rollups, +validity or ZK-Rollups Epoxy , +zkChannels, and sidechains such as Deku.

+
+
Michelson

The built-in language used by a smart contract.

+
+
+
+
Minimal stake

An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a +delegate to have baking rights and voting rights in a cycle.

+
+
Operation kinds

The main kinds of operations in the protocol are transactions (to transfer funds +or to execute smart contracts), accusations, activations, delegations, +attestations, and originations. +For the full list of operations, see Blocks and Operations.

+
+
Originated account

See smart contract.

+
+
+
+
Origination

A manager operation whose purpose is to create – that +is, to deploy – a smart contract on the Tezos blockchain.

+
+
+
+
Round

An attempt to reach consensus on a block at a given level. +A round is represented by an index, starting with 0. +Each round corresponds to a time span. +A baker with baking rights at a given round is only allowed to bake during +the round’s corresponding time span. Baking outside of one’s designated +round results in an invalid block.

+
+
Roll

deprecated; see minimal stake.

+
+
Smart contract

Account which is associated to a Michelson script. +They are created with an +explicit origination operation and are therefore sometimes called +originated accounts. The address of a smart contract always starts +with the letters KT1.

+
+
Smart Optimistic Rollups

Smart optimistic rollups constitute a layer 2 solution that can be used to deploy either a general-purpose polyvalent layer 2 blockchain +(e.g., an EVM-compatible one), or an application-specific DApp. +See Smart Optimistic Rollups.

+
+
Stake

The amount of tokens that determines a delegate’s weight in the +governance process and in the selection of its baking and +attesting rights. A delegate’s stake is usually given by the +delegate’s own tokens plus the sum of tokens delegated to +it. However, there are cases when this is not the case, see +here for details.

+
+
Staker
+

An implicit account that made a security deposit. +The implicit account must have set a delegate. +The security deposit accrues to the stake of the implicit account’s delegate and is +subject to slashing in case the delegate misbehaves – see Slashing.

+
+
+
Transaction

An operation to transfer tez between two accounts, or to run the code of a +smart contract.

+
+
+
+
Validation pass

An index (a natural number) associated with a particular kind of +operations, allowing to group them into classes. Validation passes +enable prioritizing the validation and +application of certain classes of +operations.

+
+
Voting period

Any of the proposal, exploration, cooldown, +promotion or adoption stages in the voting procedure when +amending the economic protocol.

+
+
Voting listings

The list calculated at the beginning of each voting period that contains +the staking balance (in number of mutez) of each delegate that owns more +than the minimal stake at that moment. For each delegate, the voting listings +reflect the weight of the vote emitted by the delegate when amending the +economic protocol.

+
+
+
+
+ + +
+ +
+
+ + diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js new file mode 100644 index 000000000..b598c896c --- /dev/null +++ b/src/scripts/process_downloaded_glossary.js @@ -0,0 +1,52 @@ +// Convert the glossary downloaded from the Octez docs to something that can be shown on this site + +const fs = require("fs"); +const path = require("path"); +const jsdom = require("jsdom"); +const { JSDOM } = jsdom; + +const monthNames = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', +]; + +const process_downloaded_glossary = async () => { + // TODO download current file from Octez + const file = await fs.promises.readFile(path.resolve(__dirname, './downloaded_glossary.html'), 'utf8'); + + const dom = new JSDOM(file); + + // Trim html header, body, and such out + const trimmed = dom.window.document.querySelector("div#glossary"); + + // Trim out H1 + const h1 = trimmed.querySelector("h1"); + h1.remove(); + + // Convert to string + var htmlStr = trimmed.outerHTML; + + // Fixes for MDX treating newlines as paragraphs: + htmlStr = htmlStr.replace(/([^>])$\n/gm, '$1 '); + htmlStr = htmlStr.replace(/>$\n/gm, '>'); + + // Wrap with
to apply custom styles + htmlStr = `
${htmlStr}
`; + + // Add front matter + htmlStr = '---\ntitle: Glossary\n---\n\n' + htmlStr; + + await fs.promises.writeFile(path.resolve(__dirname, '../../docs/overview/glossary.md'), htmlStr, 'utf8') +} + +process_downloaded_glossary(); From bebe4c6b722e599870a1dc87d415896483705064 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 1 Jul 2024 07:44:44 -0400 Subject: [PATCH 02/16] unused code --- src/scripts/process_downloaded_glossary.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index b598c896c..a07525126 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -5,21 +5,6 @@ const path = require("path"); const jsdom = require("jsdom"); const { JSDOM } = jsdom; -const monthNames = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December', -]; - const process_downloaded_glossary = async () => { // TODO download current file from Octez const file = await fs.promises.readFile(path.resolve(__dirname, './downloaded_glossary.html'), 'utf8'); From d8ec3c7edb71e4357395063bb4068a79ab6a3baf Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 1 Jul 2024 10:27:29 -0400 Subject: [PATCH 03/16] Remove link that the build shows as an error --- docs/architecture/governance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/governance.md b/docs/architecture/governance.md index 29cd52bd4..aed2b6f71 100644 --- a/docs/architecture/governance.md +++ b/docs/architecture/governance.md @@ -23,7 +23,7 @@ If a quorum is met, the top-voted proposal moves to the next period. Each period lasts five blockchain cycles (40,960 blocks at 30-second intervals or roughly 14 days, 5 hours), comprising roughly 2 months and 10 days. -Only [delegates](../overview/glossary#delegate) can vote on proposals. +Only delegates can vote on proposals. A delegate's voting power is the amount of tez that it has staked plus the tez that delegators have delegated to it, also called its _staking balance_. ### 1. Proposal period From bed36b278458397413cd389408c3b60d8d220c65 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 1 Jul 2024 11:21:25 -0400 Subject: [PATCH 04/16] Download the file and Use the script from the Octez docs --- .gitignore | 3 +- src/scripts/process_downloaded_glossary.js | 85 +++++++++++++++++++--- 2 files changed, 77 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 502bcd81e..1bcef622a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ node_modules .vscode/* out build - +_build +_scripts diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index a07525126..1c7a8e54f 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -1,21 +1,86 @@ // Convert the glossary downloaded from the Octez docs to something that can be shown on this site -const fs = require("fs"); -const path = require("path"); -const jsdom = require("jsdom"); +const fs = require('fs'); +const path = require('path'); +const https = require('https'); +const { spawn } = require('child_process'); +const jsdom = require('jsdom'); const { JSDOM } = jsdom; +// Utility function to download files +const download = async (url, filename) => { + const file = fs.createWriteStream(filename); + return new Promise((resolve, reject) => { + const request = https.get(url, (response) => { + response.pipe(file); + file.on('finish', () => { + file.close(); + console.log('Downloaded', url, 'and saved as', filename); + resolve(); + }); + file.on('error', (e) => { + reject(e); + }); + }); + }); +} + +// Run child process as promise +const runProcess = async (scriptFileName, targetFileName, cwd, outputFileName) => { + if (fs.existsSync(outputFileName)) { + await fs.promises.unlink(outputFileName); + } + return new Promise((resolve, reject) => { + const relativePathToTarget = path.relative(path.dirname(scriptFileName), targetFileName); + const relativePathToScript = path.relative(path.dirname(targetFileName), scriptFileName); + const run = spawn(relativePathToScript + ' ' + path.basename(targetFileName) + '> ' + outputFileName, [], { + cwd, + shell: true, + }); + + run.stderr.on('data', (data) => { + reject(data); + }); + + run.on('close', (code) => { + resolve(); + }); + }); +} + const process_downloaded_glossary = async () => { - // TODO download current file from Octez - const file = await fs.promises.readFile(path.resolve(__dirname, './downloaded_glossary.html'), 'utf8'); - const dom = new JSDOM(file); + // Conversion script expects the glossary file to in _build/ + const buildFolder = path.resolve(__dirname, '../../_build'); + if (!fs.existsSync(buildFolder)){ + fs.mkdirSync(buildFolder); + } + // Script file in _scripts/ + const scriptFolder = path.resolve(__dirname, '../../_scripts'); + if (!fs.existsSync(scriptFolder)){ + fs.mkdirSync(scriptFolder); + } + + // Download glossary and conversion script + const glossarySourceFileName = path.resolve(buildFolder, 'glossary.html'); + const scriptFileName = path.resolve(scriptFolder, 'extract_content'); + const glossaryFilePromise = download('https://tezos.gitlab.io/alpha/glossary.html', glossarySourceFileName); + const scriptFilePromise = download('https://gitlab.com/tezos/tezos/-/raw/master/docs/scripts/extract_content?ref_type=heads&inline=false', scriptFileName); + await Promise.all([glossaryFilePromise, scriptFilePromise]); + await fs.promises.chmod(scriptFileName, '777'); + + // Run conversion script + const outputFileName = path.resolve(buildFolder, 'extracted_content.html'); + await runProcess(scriptFileName, glossarySourceFileName, buildFolder, outputFileName); + const conversionScriptOutputFile = await fs.promises.readFile(outputFileName, 'utf8'); + + const dom = new JSDOM(conversionScriptOutputFile); // Trim html header, body, and such out - const trimmed = dom.window.document.querySelector("div#glossary"); + const trimmed = dom.window.document.querySelector('div#glossary'); // Trim out H1 - const h1 = trimmed.querySelector("h1"); + const h1 = trimmed.querySelector('h1'); h1.remove(); // Convert to string @@ -25,8 +90,8 @@ const process_downloaded_glossary = async () => { htmlStr = htmlStr.replace(/([^>])$\n/gm, '$1 '); htmlStr = htmlStr.replace(/>$\n/gm, '>'); - // Wrap with
to apply custom styles - htmlStr = `
${htmlStr}
`; + // Wrap with
to apply custom styles + htmlStr = `
${htmlStr}
`; // Add front matter htmlStr = '---\ntitle: Glossary\n---\n\n' + htmlStr; From c59313b103405fdf63de95faa4b509946d045962 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 1 Jul 2024 11:28:02 -0400 Subject: [PATCH 05/16] External links in new tab --- src/scripts/process_downloaded_glossary.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 1c7a8e54f..9d66e9736 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -83,6 +83,12 @@ const process_downloaded_glossary = async () => { const h1 = trimmed.querySelector('h1'); h1.remove(); + // External links in new window + const externalLinks = dom.window.document.querySelectorAll('a.external'); + externalLinks.forEach((link) => { + link.setAttribute("target", "_blank"); + }); + // Convert to string var htmlStr = trimmed.outerHTML; From b485835d4e54ee9530241756b5ad6e64cfdffdec Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 1 Jul 2024 13:47:03 -0400 Subject: [PATCH 06/16] Run script after Docusaurus build --- .github/workflows/deploy-production.yml | 2 +- .github/workflows/deploy-staging.yml | 2 +- docs/overview/glossary.md | 2 +- src/css/custom.css | 2 +- src/scripts/process_downloaded_glossary.js | 43 +++++++++++++++------- 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 3a1a01746..5ac6deb73 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -18,8 +18,8 @@ jobs: with: node-version: 18 - run: npm ci - - run: npm run glossary - run: npm run build + - run: npm run glossary - uses: aws-actions/configure-aws-credentials@v2 with: aws-access-key-id: ${{ secrets.AWS_S3_PRODUCTION_KEY_ID }} diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 9fe18234b..6b4c90406 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -18,8 +18,8 @@ jobs: with: node-version: 18 - run: npm ci - - run: npm run glossary - run: BUILD_ENV=staging npm run build + - run: npm run glossary - uses: aws-actions/configure-aws-credentials@v2 with: aws-access-key-id: ${{ secrets.AWS_S3_STAGE_KEY_ID }} diff --git a/docs/overview/glossary.md b/docs/overview/glossary.md index 9c8031bfd..7fcc00aff 100644 --- a/docs/overview/glossary.md +++ b/docs/overview/glossary.md @@ -4,4 +4,4 @@ title: Glossary -For a glossary of Tezos terms, see [Glossary](https://tezos.gitlab.io/alpha/glossary.html). +

For a glossary of Tezos terms, see Glossaru.

diff --git a/src/css/custom.css b/src/css/custom.css index 21ec66513..b9ac48544 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -297,6 +297,6 @@ article a[target="_blank"]:after { font-style: italic; } -.imported-glossary dt { +#imported-glossary dt { font-weight: bold; } diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 9d66e9736..43246784c 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -50,6 +50,13 @@ const runProcess = async (scriptFileName, targetFileName, cwd, outputFileName) = const process_downloaded_glossary = async () => { + // Check that the build has run and the output file is there + const glossaryBuildFilePath = path.resolve(__dirname, '../../build/overview/glossary/index.html'); + if (!fs.existsSync(glossaryBuildFilePath)){ + console.error('Could not find built glossary file; run "npm run build" first.'); + process.exit(1); + } + // Conversion script expects the glossary file to in _build/ const buildFolder = path.resolve(__dirname, '../../_build'); if (!fs.existsSync(buildFolder)){ @@ -86,23 +93,31 @@ const process_downloaded_glossary = async () => { // External links in new window const externalLinks = dom.window.document.querySelectorAll('a.external'); externalLinks.forEach((link) => { - link.setAttribute("target", "_blank"); + link.setAttribute('target', '_blank'); }); - // Convert to string - var htmlStr = trimmed.outerHTML; - - // Fixes for MDX treating newlines as paragraphs: - htmlStr = htmlStr.replace(/([^>])$\n/gm, '$1 '); - htmlStr = htmlStr.replace(/>$\n/gm, '>'); - // Wrap with
to apply custom styles - htmlStr = `
${htmlStr}
`; - - // Add front matter - htmlStr = '---\ntitle: Glossary\n---\n\n' + htmlStr; - - await fs.promises.writeFile(path.resolve(__dirname, '../../docs/overview/glossary.md'), htmlStr, 'utf8') + const wrapper = new JSDOM('
'); + const imported_glossary = wrapper.window.document.querySelector('div#imported-glossary'); + imported_glossary.appendChild(trimmed); + + // Load existing glossary output file + const existingGlossary = await fs.promises.readFile(glossaryBuildFilePath, 'utf8'); + + // Replace content in existing glossary from processed glossary + const existingGlossaryDom = new JSDOM(existingGlossary); + const copied_imported_glossary = existingGlossaryDom.window.document.importNode(imported_glossary, true); + const elementToReplace = existingGlossaryDom.window.document.querySelector("p#glossary_replace"); + const parent = elementToReplace.parentNode; + parent.appendChild(copied_imported_glossary); + parent.removeChild(elementToReplace); + + const outputString = ` + + ${existingGlossaryDom.window.document.documentElement.innerHTML} + `; + + await fs.promises.writeFile(glossaryBuildFilePath, outputString, 'utf8'); } process_downloaded_glossary(); From cc4ca235b45361d6591711257551ee12cfecb2ba Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Mon, 1 Jul 2024 14:43:35 -0400 Subject: [PATCH 07/16] typo --- docs/overview/glossary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/overview/glossary.md b/docs/overview/glossary.md index 7fcc00aff..d66c90903 100644 --- a/docs/overview/glossary.md +++ b/docs/overview/glossary.md @@ -4,4 +4,4 @@ title: Glossary -

For a glossary of Tezos terms, see Glossaru.

+

For a glossary of Tezos terms, see Glossary.

From bda828f6d15947f0420dab7acd8741efbdb4942d Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 07:20:56 -0400 Subject: [PATCH 08/16] Remove this downloaded file --- src/scripts/downloaded_glossary.html | 347 --------------------------- 1 file changed, 347 deletions(-) delete mode 100644 src/scripts/downloaded_glossary.html diff --git a/src/scripts/downloaded_glossary.html b/src/scripts/downloaded_glossary.html deleted file mode 100644 index fd0d9b74b..000000000 --- a/src/scripts/downloaded_glossary.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - - - - Glossary — Tezos (local branch, 2024/06/25 14:19) documentation - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
-
- -
-

Glossary

-

This glossary is divided in two sections, the first one concerns Tezos, and -the second one concerns the economic protocol. The definitions in the latter -section may be different for other protocol versions.

-
-

Tezos

-
-
Block

The Tezos blockchain is a linked list of blocks (or actually, a tree when several competing branches exist). -Blocks conceptually contain a header and a list of operations, -which are specific to the economic protocol.

-

The header itself decomposes into a shell header (common to all Tezos economic protocols), and a protocol-specific header. -The shell header contains protocol-agnostic data such as the predecessor’s block hash and the block’s timestamp.

-
-
-
-
Context

The state of the blockchain. The context is defined by the -economic protocol and typically includes information such as -“this account is credited with this many tez” and “this is the -code for that smart contract.”

-

The context is modified by operations. For example, an -operation can transfer tez from one account to another, which modifies the -part of the context that tracks account credit.

-
-
Economic protocol

The economic protocol is the set of rules defining valid operations and blocks, how the network agrees on the next block to build (the consensus algorithm), -and how operations update the blockchain state, also called context.

-

In Tezos, the economic protocol can be upgraded without interruption or -forking of the blockchain. This is because the procedure for an upgrade is also defined within the economic protocol, which can thus update itself.

-
-
Fitness (a.k.a. score, weight)

For each block, the consensus algotrithm can compute a score called fitness which determines the quality of the chain leading to that block. -The shell changes the head of the chain to the valid block that has the highest fitness.

-
-
Height

See level.

-
-
-
-
Level (a.k.a. block height)

The position of a block in the blockchain, that is, the number of blocks -since the genesis block, where the genesis block is at level 0.

-
-
Mempool

A pool (set) of operations maintained by a node and not yet included in a block.

-
-
-
-
Metadata

A (block or operation) metadata is a piece of data -computed as a result of the application of the -block or operation on an associated context. The metadata -consists of many pieces of information such as the operation receipts, -rewards updates, voting period, etc.

-

A block’s metadata is the collections of operations metadata for all the operations included in the block (if the validation was successful).

-

For a detailed metadata content check the Paris RPCs - Reference under -the prefix ../<block_id>/metadata.

-
-
Node

A peer in the P2P network. It maintains a local state and propagates blocks -and operations.

-
-
Operation

An operation transforms the context; this is what makes the state of the chain -change. Operations are grouped into blocks; thus, the chain progresses in -batches. -For the different kinds of operations defined by the protocol, see operation kinds.

-
-
Score

See fitness.

-
-
Shell

The shell is a software component of the node. It is parameterized by a -specific economic protocol. It serves as the bridge between the P2P layer -(handling communication between nodes) and the economic protocol layer -(handling the context, operation application, scoring, etc.).

-
-
Weight

See fitness.

-
-
-
-
-

Protocol

-
-
Accuser

When a delegate attempts double signing (or when it tries -to abuse the network in another similar way), another delegate can make an -accusation, by providing evidence of the offense. The delegate injecting the accusation in a newly baked block is called the accuser.

-

The accuser is awarded some funds from the security deposit of the accused.

-

When using Octez, accusation operations are emitted by the -accuser daemon. Note that this daemon is not associated to a delegate: accusation operations are anonymous, and any delegate can include them in a block.

-
-
-
-
Account

An account is an address managed by the protocol. -In the context, each account is associated with a balance (an amount of -tez available).

-

An account can be either an originated account or an implicit account.

-
-
Baker

When a delegate creates a new block, it is called the baker of this block. -Baking rights are distributed to different delegates based on their -available stake. Only a delegate with baking rights -is allowed to bake. -The baker selects transactions from the mempool to be included in the block it bakes.

-

When using Octez, baking and other consensus actions are handled by the baker -daemon, on behalf of one or more delegate accounts. -By extension, a baker designates the owner of such a delegate account, typically running the baker daemon on its behalf.

-
-
Baking

The act of creating a new block by a baker.

-
-
Baking rights

Baking/attesting a block can only be done by a delegate who holds the -baking/attesting right for that block level and round. At the start of a cycle, -baking and attesting rights are computed for all the block levels and rounds in the -cycle, based on the proportion of the stake of each delegate.

-

For each block level and round, there is exactly one account that is allowed to bake, but several accounts are allowed to attest.

-
-
Burn

To ensure responsible use of the storage space on the public blockchain, -there are some costs charged to users for consuming storage. These -costs are burnt (i.e., the amount of tez is destroyed). For example, -a per-byte storage cost is burnt for increasing the storage space of a -smart contract; a fixed amount is burnt for allocating a new contract -(which consumes space by storing its address on the blockchain).

-

See also fee.

-
-
Constant

Protocols are parameterized by several parameters called protocol constants, which may vary from one protocol to another or from one network to another.

-
-
Contract

See account.

-
-
-
-
Cycle

A cycle is a sequence of consecutive blocks of fixed length (given by a protocol constant). E.g., cycle 12 started at block -level 49152 and ended at block level 53248.

-

Cycles are used as a unit of “time” in the block chain. For example, the -different phases in the amendment voting procedures are defined based on -numbers of cycles.

-

The length of a cycle is a (parametric) protocol -constant, and thus might change across different -Tezos protocols.

-
-
-
-
Delegate

An implicit account that can participate in consensus and in governance. -Actual participation is under further provisions, like having a minimal stake. -An implicit account becomes a delegate by registering as such. -Through delegation, other accounts can delegate their rights to a delegate account. -The delegate’s rights are calculated based on its stake. -Note that tz4 accounts cannot be delegates.

-
-
Delegation

An operation in which an account designates a -delegate. The delegating account’s balance increases the delegate’s stake and consequently -its baking rights and attesting rights. However, the delegate does not control the funds of -the delegating account, e.g., it can not spend them.

-
-
-
-
Double signing

The situation when a baker signs two different blocks at the same level and same round, -is called double baking. Double baking is detrimental to the network and might be -indicative of an attempt to double spend. -The same goes for signing two different attestations at the same level and the same round. -As such, double signing (i.e., double baking or double attesting) is punished by the -network: an accuser can provide proof of the double signing to be awarded -part of the double signer’s deposit – see Slashing.

-
-
Failing Noop

The Failing_noop operation implements a No-op, which always -fails at application time, and -should never appear in applied -blocks. This operation allows end-users to -sign arbitrary messages which have no -computational semantics.

-
-
Attesting

When a block is created and propagated on the network, delegates that have -attesting rights for the matching block level and round can emit an attestation operation. -Attestation operations are included in the next block.

-
-
Attesting rights

See baking rights.

-
-
-
-
Fee

To ensure responsible use of computation resources of other nodes, and also to encourage active participation in the consensus protocol, -users pay fees to bakers for including their operations in blocks. -For example, fees are paid to a baker for operations such as a transaction or a revelation of a public key.

-

Currently, only manager operations -require collecting fees from its sender account.

-

See also burn.

-
-
-
-
Gas

A measure of the number of elementary steps performed during -the execution of a smart contract. Gas is used to measure how -much computing power is used to execute a smart contract.

-
-
-
-
Implicit account

An account that is linked to a public key. Contrary to a smart -contract, an implicit account cannot include a script and it -cannot reject incoming transactions.

-

If registered, an implicit account can act as a delegate.

-

The address of an implicit account always starts with the -letters tz followed by 1, 2, 3, or 4 (depending on the -signature scheme) and finally the hash of the public key. -See Accounts and addresses for a more detailed explanation on addresses.

-
-
Layer 1

The primary blockchain i.e. the Tezos chain. Within any blockchain ecosystem, Layer 1 (L1) refers to the main chain to -which side chains, rollups, or other protocols connect and settle to. The Layer 1 chain is deemed to be most -secure, since it has the most value (or stake) tied to it, and be most decentralized and censorship resistant. -However, transaction space is limited leading to low throughput and possibly high transaction costs. -See Layer 2.

-
-
Layer 2

Layer 2 (L2) includes sidechains, rollups, payment channels, etc. that batch their transactions and -write to the layer 1 chain. By processing transactions on layer 2 networks, -greater scalability in speed and throughput can be achieved by the ecosystem overall, since the number of transactions -the layer 1 can process directly is limited. By cementing transactions from a L2 to L1, -the security of the L1 chain backs those operations. In Tezos there are a number of layer 2 solutions, -including Smart Optimistic Rollups, -validity or ZK-Rollups Epoxy , -zkChannels, and sidechains such as Deku.

-
-
Michelson

The built-in language used by a smart contract.

-
-
-
-
Minimal stake

An amount of tez (e.g., 6000ꜩ) serving as a minimal amount for a -delegate to have baking rights and voting rights in a cycle.

-
-
Operation kinds

The main kinds of operations in the protocol are transactions (to transfer funds -or to execute smart contracts), accusations, activations, delegations, -attestations, and originations. -For the full list of operations, see Blocks and Operations.

-
-
Originated account

See smart contract.

-
-
-
-
Origination

A manager operation whose purpose is to create – that -is, to deploy – a smart contract on the Tezos blockchain.

-
-
-
-
Round

An attempt to reach consensus on a block at a given level. -A round is represented by an index, starting with 0. -Each round corresponds to a time span. -A baker with baking rights at a given round is only allowed to bake during -the round’s corresponding time span. Baking outside of one’s designated -round results in an invalid block.

-
-
Roll

deprecated; see minimal stake.

-
-
Smart contract

Account which is associated to a Michelson script. -They are created with an -explicit origination operation and are therefore sometimes called -originated accounts. The address of a smart contract always starts -with the letters KT1.

-
-
Smart Optimistic Rollups

Smart optimistic rollups constitute a layer 2 solution that can be used to deploy either a general-purpose polyvalent layer 2 blockchain -(e.g., an EVM-compatible one), or an application-specific DApp. -See Smart Optimistic Rollups.

-
-
Stake

The amount of tokens that determines a delegate’s weight in the -governance process and in the selection of its baking and -attesting rights. A delegate’s stake is usually given by the -delegate’s own tokens plus the sum of tokens delegated to -it. However, there are cases when this is not the case, see -here for details.

-
-
Staker
-

An implicit account that made a security deposit. -The implicit account must have set a delegate. -The security deposit accrues to the stake of the implicit account’s delegate and is -subject to slashing in case the delegate misbehaves – see Slashing.

-
-
-
Transaction

An operation to transfer tez between two accounts, or to run the code of a -smart contract.

-
-
-
-
Validation pass

An index (a natural number) associated with a particular kind of -operations, allowing to group them into classes. Validation passes -enable prioritizing the validation and -application of certain classes of -operations.

-
-
Voting period

Any of the proposal, exploration, cooldown, -promotion or adoption stages in the voting procedure when -amending the economic protocol.

-
-
Voting listings

The list calculated at the beginning of each voting period that contains -the staking balance (in number of mutez) of each delegate that owns more -than the minimal stake at that moment. For each delegate, the voting listings -reflect the weight of the vote emitted by the delegate when amending the -economic protocol.

-
-
-
-
- - -
- -
-
- - From 681bad850e9c095240619de887fb0f8d91334d3b Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 09:39:17 -0400 Subject: [PATCH 09/16] Go back to editing glossary.md before build --- .github/workflows/deploy-production.yml | 2 +- .github/workflows/deploy-staging.yml | 2 +- .gitignore | 3 +- src/scripts/process_downloaded_glossary.js | 61 ++++++++++------------ 4 files changed, 30 insertions(+), 38 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 5ac6deb73..3a1a01746 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -18,8 +18,8 @@ jobs: with: node-version: 18 - run: npm ci - - run: npm run build - run: npm run glossary + - run: npm run build - uses: aws-actions/configure-aws-credentials@v2 with: aws-access-key-id: ${{ secrets.AWS_S3_PRODUCTION_KEY_ID }} diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 6b4c90406..9fe18234b 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -18,8 +18,8 @@ jobs: with: node-version: 18 - run: npm ci - - run: BUILD_ENV=staging npm run build - run: npm run glossary + - run: BUILD_ENV=staging npm run build - uses: aws-actions/configure-aws-credentials@v2 with: aws-access-key-id: ${{ secrets.AWS_S3_STAGE_KEY_ID }} diff --git a/.gitignore b/.gitignore index 1bcef622a..d94b8b952 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,4 @@ node_modules .vscode/* out build -_build -_scripts +_glossaryBuild diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 43246784c..46d8546a0 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -31,10 +31,10 @@ const runProcess = async (scriptFileName, targetFileName, cwd, outputFileName) = await fs.promises.unlink(outputFileName); } return new Promise((resolve, reject) => { - const relativePathToTarget = path.relative(path.dirname(scriptFileName), targetFileName); const relativePathToScript = path.relative(path.dirname(targetFileName), scriptFileName); const run = spawn(relativePathToScript + ' ' + path.basename(targetFileName) + '> ' + outputFileName, [], { cwd, + // Use shell: true here so the script can use the `> output_file` syntax to write output to a file shell: true, }); @@ -48,24 +48,19 @@ const runProcess = async (scriptFileName, targetFileName, cwd, outputFileName) = }); } -const process_downloaded_glossary = async () => { +const process_glossary = async () => { - // Check that the build has run and the output file is there - const glossaryBuildFilePath = path.resolve(__dirname, '../../build/overview/glossary/index.html'); - if (!fs.existsSync(glossaryBuildFilePath)){ - console.error('Could not find built glossary file; run "npm run build" first.'); - process.exit(1); - } + const repoRoot = path.resolve(__dirname, '../../'); - // Conversion script expects the glossary file to in _build/ - const buildFolder = path.resolve(__dirname, '../../_build'); + // Conversion script expects the downloaded glossary file to be in _build/ + const buildFolder = path.resolve(repoRoot, '_glossaryBuild/_build'); if (!fs.existsSync(buildFolder)){ - fs.mkdirSync(buildFolder); + fs.mkdirSync(buildFolder, { recursive: true }); } // Script file in _scripts/ - const scriptFolder = path.resolve(__dirname, '../../_scripts'); + const scriptFolder = path.resolve(repoRoot, '_glossaryBuild/_scripts'); if (!fs.existsSync(scriptFolder)){ - fs.mkdirSync(scriptFolder); + fs.mkdirSync(scriptFolder, { recursive: true }); } // Download glossary and conversion script @@ -79,19 +74,20 @@ const process_downloaded_glossary = async () => { // Run conversion script const outputFileName = path.resolve(buildFolder, 'extracted_content.html'); await runProcess(scriptFileName, glossarySourceFileName, buildFolder, outputFileName); + console.log('Used Octez docs script to pull the content from its glossary'); const conversionScriptOutputFile = await fs.promises.readFile(outputFileName, 'utf8'); - const dom = new JSDOM(conversionScriptOutputFile); + const downloadedGlossaryDom = new JSDOM(conversionScriptOutputFile); // Trim html header, body, and such out - const trimmed = dom.window.document.querySelector('div#glossary'); + const trimmed = downloadedGlossaryDom.window.document.querySelector('div#glossary'); // Trim out H1 const h1 = trimmed.querySelector('h1'); h1.remove(); // External links in new window - const externalLinks = dom.window.document.querySelectorAll('a.external'); + const externalLinks = trimmed.querySelectorAll('a.external'); externalLinks.forEach((link) => { link.setAttribute('target', '_blank'); }); @@ -101,23 +97,20 @@ const process_downloaded_glossary = async () => { const imported_glossary = wrapper.window.document.querySelector('div#imported-glossary'); imported_glossary.appendChild(trimmed); - // Load existing glossary output file - const existingGlossary = await fs.promises.readFile(glossaryBuildFilePath, 'utf8'); - - // Replace content in existing glossary from processed glossary - const existingGlossaryDom = new JSDOM(existingGlossary); - const copied_imported_glossary = existingGlossaryDom.window.document.importNode(imported_glossary, true); - const elementToReplace = existingGlossaryDom.window.document.querySelector("p#glossary_replace"); - const parent = elementToReplace.parentNode; - parent.appendChild(copied_imported_glossary); - parent.removeChild(elementToReplace); - - const outputString = ` - - ${existingGlossaryDom.window.document.documentElement.innerHTML} - `; - - await fs.promises.writeFile(glossaryBuildFilePath, outputString, 'utf8'); + // Convert to string and remove line breaks to prevent MDX processing from making them into paragraph tags + let imported_glossary_str = imported_glossary.innerHTML; + imported_glossary_str = imported_glossary_str.replace(/([^>])$\n/gm, '$1 '); + imported_glossary_str = imported_glossary_str.replace(/>$\n/gm, '>'); + + // Overwrite existing glossary.md file + let outputString = '---\ntitle: Glossary\n---\n\n'; + outputString += imported_glossary_str; + const glossaryFilePath = path.resolve(repoRoot, 'docs/overview/glossary.md'); + if (fs.existsSync(glossaryFilePath)){ + fs.unlinkSync(glossaryFilePath); + } + await fs.promises.writeFile(glossaryFilePath, outputString, 'utf8'); + console.log('Wrote new glossary to', glossaryFilePath); } -process_downloaded_glossary(); +process_glossary(); From c66bb2e5ae62ec3846893c563fbaa9a3c1d4e18f Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 10:44:35 -0400 Subject: [PATCH 10/16] Do this here instead of in vercel --- .github/workflows/deploy-production.yml | 1 - .github/workflows/deploy-staging.yml | 1 - package.json | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 3a1a01746..447a06942 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -18,7 +18,6 @@ jobs: with: node-version: 18 - run: npm ci - - run: npm run glossary - run: npm run build - uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 9fe18234b..f41a80fab 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -18,7 +18,6 @@ jobs: with: node-version: 18 - run: npm ci - - run: npm run glossary - run: BUILD_ENV=staging npm run build - uses: aws-actions/configure-aws-credentials@v2 with: diff --git a/package.json b/package.json index c310c2ac8..88278a3bf 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,14 @@ "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start", - "build": "docusaurus build", + "build": "node ./src/scripts/process_downloaded_glossary.js && docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", - "test": "mocha", - "glossary": "node ./src/scripts/process_downloaded_glossary.js" + "test": "mocha" }, "dependencies": { "@docusaurus/core": "3.2.1", From 039a2a0c6be6ed4d3afcddf6e5578c7eeca2d44a Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 12:11:20 -0400 Subject: [PATCH 11/16] Use outerhtml to include the container div --- src/scripts/process_downloaded_glossary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 46d8546a0..3cf63d339 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -98,7 +98,7 @@ const process_glossary = async () => { imported_glossary.appendChild(trimmed); // Convert to string and remove line breaks to prevent MDX processing from making them into paragraph tags - let imported_glossary_str = imported_glossary.innerHTML; + let imported_glossary_str = imported_glossary.outerHTML; imported_glossary_str = imported_glossary_str.replace(/([^>])$\n/gm, '$1 '); imported_glossary_str = imported_glossary_str.replace(/>$\n/gm, '>'); From 590c368ab36e054f3b169ab18c1881d44470b34a Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 12:23:03 -0400 Subject: [PATCH 12/16] Use active instead of alpha --- src/scripts/process_downloaded_glossary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 3cf63d339..45864253f 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -66,7 +66,7 @@ const process_glossary = async () => { // Download glossary and conversion script const glossarySourceFileName = path.resolve(buildFolder, 'glossary.html'); const scriptFileName = path.resolve(scriptFolder, 'extract_content'); - const glossaryFilePromise = download('https://tezos.gitlab.io/alpha/glossary.html', glossarySourceFileName); + const glossaryFilePromise = download('https://tezos.gitlab.io/active/glossary.html', glossarySourceFileName); const scriptFilePromise = download('https://gitlab.com/tezos/tezos/-/raw/master/docs/scripts/extract_content?ref_type=heads&inline=false', scriptFileName); await Promise.all([glossaryFilePromise, scriptFilePromise]); await fs.promises.chmod(scriptFileName, '777'); From d994d619326e8280741ba03cd94b689f79e8c01d Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 13:07:53 -0400 Subject: [PATCH 13/16] Add script to fix anchor problem --- src/components/GlossaryAnchorScript.jsx | 10 ++++++++++ src/scripts/process_downloaded_glossary.js | 2 ++ static/scripts/anchorScript.js | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 src/components/GlossaryAnchorScript.jsx create mode 100644 static/scripts/anchorScript.js diff --git a/src/components/GlossaryAnchorScript.jsx b/src/components/GlossaryAnchorScript.jsx new file mode 100644 index 000000000..18d5be5d4 --- /dev/null +++ b/src/components/GlossaryAnchorScript.jsx @@ -0,0 +1,10 @@ +import Head from '@docusaurus/Head'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + +export default function GlossaryAnchorScript() { + return ( + + + + ); +} \ No newline at end of file diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 45864253f..6e52581ac 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -104,6 +104,8 @@ const process_glossary = async () => { // Overwrite existing glossary.md file let outputString = '---\ntitle: Glossary\n---\n\n'; + // Fix for anchor links taking you too far down the page + outputString += 'import GlossaryAnchorScript from \'@site/src/components/GlossaryAnchorScript\';\n\n\n\n'; outputString += imported_glossary_str; const glossaryFilePath = path.resolve(repoRoot, 'docs/overview/glossary.md'); if (fs.existsSync(glossaryFilePath)){ diff --git a/static/scripts/anchorScript.js b/static/scripts/anchorScript.js new file mode 100644 index 000000000..4b66fa210 --- /dev/null +++ b/static/scripts/anchorScript.js @@ -0,0 +1,4 @@ +// Fix for anchor links taking you too far down the page +window.addEventListener("hashchange", function () { + window.scrollTo(window.scrollX, window.scrollY - 100); +}); \ No newline at end of file From 24bf2ea85dc21f6ccd5baaea8316ed402da74fd3 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 13:13:44 -0400 Subject: [PATCH 14/16] Use className instead of class in MDX --- src/scripts/process_downloaded_glossary.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 6e52581ac..c0795bda1 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -97,11 +97,16 @@ const process_glossary = async () => { const imported_glossary = wrapper.window.document.querySelector('div#imported-glossary'); imported_glossary.appendChild(trimmed); + + // Convert to string and remove line breaks to prevent MDX processing from making them into paragraph tags let imported_glossary_str = imported_glossary.outerHTML; imported_glossary_str = imported_glossary_str.replace(/([^>])$\n/gm, '$1 '); imported_glossary_str = imported_glossary_str.replace(/>$\n/gm, '>'); + // Convert class to className because we're in MDX now + imported_glossary_str = imported_glossary_str.replaceAll('class="', 'className="'); + // Overwrite existing glossary.md file let outputString = '---\ntitle: Glossary\n---\n\n'; // Fix for anchor links taking you too far down the page From f6050b5dc2068dc46d9fe8236d68a070286f6377 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 25 Jul 2024 11:06:06 -0400 Subject: [PATCH 15/16] Element changed from a div to a section --- src/scripts/process_downloaded_glossary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index c0795bda1..d66f660a6 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -80,7 +80,7 @@ const process_glossary = async () => { const downloadedGlossaryDom = new JSDOM(conversionScriptOutputFile); // Trim html header, body, and such out - const trimmed = downloadedGlossaryDom.window.document.querySelector('div#glossary'); + const trimmed = downloadedGlossaryDom.window.document.querySelector('#glossary'); // Trim out H1 const h1 = trimmed.querySelector('h1'); From 664de29cc42e5f4e170e226fbc2b213cc1fa694f Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Thu, 25 Jul 2024 16:39:56 -0400 Subject: [PATCH 16/16] Handle the find-replace in the script myself --- src/scripts/process_downloaded_glossary.js | 59 ++++++---------------- 1 file changed, 16 insertions(+), 43 deletions(-) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index d66f660a6..fd1f73b81 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -25,59 +25,21 @@ const download = async (url, filename) => { }); } -// Run child process as promise -const runProcess = async (scriptFileName, targetFileName, cwd, outputFileName) => { - if (fs.existsSync(outputFileName)) { - await fs.promises.unlink(outputFileName); - } - return new Promise((resolve, reject) => { - const relativePathToScript = path.relative(path.dirname(targetFileName), scriptFileName); - const run = spawn(relativePathToScript + ' ' + path.basename(targetFileName) + '> ' + outputFileName, [], { - cwd, - // Use shell: true here so the script can use the `> output_file` syntax to write output to a file - shell: true, - }); - - run.stderr.on('data', (data) => { - reject(data); - }); - - run.on('close', (code) => { - resolve(); - }); - }); -} - const process_glossary = async () => { const repoRoot = path.resolve(__dirname, '../../'); - // Conversion script expects the downloaded glossary file to be in _build/ - const buildFolder = path.resolve(repoRoot, '_glossaryBuild/_build'); + const buildFolder = path.resolve(repoRoot, '_glossaryBuild/'); if (!fs.existsSync(buildFolder)){ fs.mkdirSync(buildFolder, { recursive: true }); } - // Script file in _scripts/ - const scriptFolder = path.resolve(repoRoot, '_glossaryBuild/_scripts'); - if (!fs.existsSync(scriptFolder)){ - fs.mkdirSync(scriptFolder, { recursive: true }); - } // Download glossary and conversion script const glossarySourceFileName = path.resolve(buildFolder, 'glossary.html'); - const scriptFileName = path.resolve(scriptFolder, 'extract_content'); const glossaryFilePromise = download('https://tezos.gitlab.io/active/glossary.html', glossarySourceFileName); - const scriptFilePromise = download('https://gitlab.com/tezos/tezos/-/raw/master/docs/scripts/extract_content?ref_type=heads&inline=false', scriptFileName); - await Promise.all([glossaryFilePromise, scriptFilePromise]); - await fs.promises.chmod(scriptFileName, '777'); - - // Run conversion script - const outputFileName = path.resolve(buildFolder, 'extracted_content.html'); - await runProcess(scriptFileName, glossarySourceFileName, buildFolder, outputFileName); - console.log('Used Octez docs script to pull the content from its glossary'); - const conversionScriptOutputFile = await fs.promises.readFile(outputFileName, 'utf8'); + await Promise.resolve(glossaryFilePromise); - const downloadedGlossaryDom = new JSDOM(conversionScriptOutputFile); + const downloadedGlossaryDom = new JSDOM(await fs.promises.readFile(glossarySourceFileName, 'utf8')); // Trim html header, body, and such out const trimmed = downloadedGlossaryDom.window.document.querySelector('#glossary'); @@ -92,13 +54,24 @@ const process_glossary = async () => { link.setAttribute('target', '_blank'); }); + // Internal links go to Octez docs + const internalLinks = trimmed.querySelectorAll('a.reference.internal'); + internalLinks.forEach((link) => { + if (link.getAttribute('href').startsWith('../')) { + const newHref = link.getAttribute('href').replace('../', 'https://tezos.gitlab.io/'); + link.setAttribute('href', newHref); + link.setAttribute('target', '_blank'); + } else if (!link.getAttribute('href').startsWith('#')) { + link.setAttribute('href', 'https://tezos.gitlab.io/active/' + link.getAttribute('href')); + link.setAttribute('target', '_blank'); + } + }); + // Wrap with
to apply custom styles const wrapper = new JSDOM('
'); const imported_glossary = wrapper.window.document.querySelector('div#imported-glossary'); imported_glossary.appendChild(trimmed); - - // Convert to string and remove line breaks to prevent MDX processing from making them into paragraph tags let imported_glossary_str = imported_glossary.outerHTML; imported_glossary_str = imported_glossary_str.replace(/([^>])$\n/gm, '$1 ');