Skip to content

Commit

Permalink
Mumbai (#2378)
Browse files Browse the repository at this point in the history
* update Taquito test configs to support Mumbai runs (#2312)

* update Taquito test configs to support Mumbai runs

* updated some integration tests to point to mumbainet

* pdate constant values for mumbainet

* removed accidental change to mondaynet test

* fix: removed consumed_gas from update_consensus_key return result for mumbainet (#2311)

re #2273

* feat(michel-codec): add support for bytes  (#2310)

* feat(michel-codec): add support for bytes for operations and lsl/r x/or not

fix: change test protocol name to mumbai

chore: add integration test. broken currently

Call setup() to request keys

chore(integration tests): add tests for mondaynet new bytes support

chore: change messages and clean

chore: add lima test

* chore: update tests for mumbai

* chore: modify paths for imports

* refactor: pr comments

* monday -> alpha name change for test

* add check to test

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>

* feat: start support bytes conversion 2268 (#2316)

* feat: start support bytes conversion 2268

close #2268

* feat: add suport local-forging BYTES and NAT and tests'

* chore: update test names

---------

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>

* 2307 smart rollup types (#2324)

* feat: type support init smart rollup

* chore: fix typo add test with mock data

* feat: may remove new file, continue types

* adjust enums

* feat: add types for smart rollup remaining. remaining work on refute/timeout

* feat: add zk ops and need to check complex types and start testing

* refactor: remove refute / timeout types smart_rollup

* refactor: adjust type

* chore: add test smart rollup add messages and adjust type conflicts

* chore: add test data execute outbox message

* refactor: correct wrong type

* add back no-any eslint ignore

* refactor: correct types update test suite execute outbox

* refactor: remove other smart contract op kinds types and zk types

* remove from opkind

* fix spacing

* refactor: fix up caught errors && clarify types

* adjust type

---------

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>

* remove kathmandu references (#2323)

* 2318 estimate decimal (#2329)

* update estimate overrides to throw error when decimal values are being passed as well as update tests

* updated description

* Run integration tests against Flextesa Mumbainet (#2343)

* Run integration tests against Flextesa Mumbainet

* Fix typos in integration-tests/config.ts

* 2270 support new rpc endpoint ticket balance and all ticket balance (#2313)

* feat: support new rpc endpoint ticket_balance

re #2270

* feat: support new rpc endpoint all_ticket_balances

re #2270

* fix: changed http method of all_ticket_balances to get

re #2270

* fix: type definition mistake

re #2270

* docs: updated docs for getTicketBalance rpc endpoint

#2270

* fix: remove // in formatCacheKey when passed rpcMethodData and updated doc

re #2270

* test: added rpc endpoint ticketBalance and allTicketBalances unit test

re #2270

* test: added rpc endpoint ticketBalance and allTicketBalances integration test

re #2270

* fix: added mumbai protocol to have empty txRollupAddress in known-contracts file

* fix: correct misused of rpcMethodParams in RpcClientCache

* style: address comment to keep type names uppercase

re #2270

* test: removed not needed contract code and use code_with_ticket.ts instead

re #2270

* test: removed console.log

re #2270

* test: added try catch when originating contract and removed non-null assertion

re #2270

* test: removed all tx_rollup references out of integration-tests

* test: removed more tx rollup references in integration tests and some styles and doc update

re #2270

* style: addressed comments regard style and docs

* style: fixed ci run error

* test: added more assertion to integration test

* test: added array assertion for getAllTicketBalances result

re #2270

* ci: added flextesa mumbaibox to ci run

* fix: fix ci run

* revert: revert ci changes and update integration test to target correct testnet

* Run integration tests pipelines when PR are merged to `mumbai` branch

* feat(local-forger): 2308 support smart rollup originate local forging (#2339)

feat: start implementation with tests smart rollup add messages need refactor

feat: add forging for execute outbox message with mock bytes change bytes name

chore: more expects for execute outbox message test

refactor: change param need add messages

fix: fix missed decoders and remove unneeded

refactor: integration tests  sr originate, add message. fix decoder and needs more testing

fix: properly parse array from add messages message

needs cleanup and refactor

refactor: change name

feat: support forging execute_outbox_message

fix: dont test sr against less than mumbai

fix: fix broken test from proper implementation

fix: bad file structure for tests

refactor: update naming

refactor: add better names and refactor unneeded

format alltest cases

refactor: format and missed name change

refactor: update type doc fix test name

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>

* 2320 support transfer ticket operation for mumbai (#2341)

* feat: support transfer_ticket operation change for mumbai

re #2320

* feat: eabling transfer ticket between implicit in rpc-batch-provider

re #2320

* test: added integration test for trasfnerTicket operation between implicit and originated account

re #2320

* test: updated comments and adjusted indentation

re #2320

* fix: updated OperationResultTransferTicket property

re #2320

* style: format document

* docs: minor typo

* 2350 tz4 validation (#2362)

* added validation case for tz4 addresses

* adjusted codec test

* add mumbai condition to run test

* Added support for smart_rollup_add_messages op and relevant tests (#2352)

* Added support for smart_rollup_add_messages op and relevant tests

* add mumbai condition on new integration test

* remove debug statement

* addressed PR comments

* added batch tests and fixed typo in estimates

* added mumbai condition

* Addressed PR comments

* added more details in docs

* feat: added type ConstantsResponseProto016 and updated rpc-get-protocol-constnats.spec.ts (#2376)

re #2375

* remove mumbai branch condition from github workflow

* 485 remove babylon kathmandu (#2373)

* perf: update some examples for ghostnet

remove file change that will conflict

* refactor: remove unused variables from integration tests

* refactor: slight improvement, remove tx rollup contracts

* refactor: remove past protocol check

* refactor: remove tx from mondaynet github workflow

---------

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>

* updated docusaurus to latest version (#2381)

* updated protocol hash in favour of PtMumbai2 (#2387)

* updated protocol hash in favour of PtMumbai2

* updated integration tests and contract references

* updated protocol hash in local forger

* updated configs

* reverted lima contracts

* chore(releng) bump version to 16.0.0-beta-RC.0

---------

Co-authored-by: hui-an-yang <106410553+hui-an-yang@users.noreply.github.com>
Co-authored-by: Zainen <72581075+zainen@users.noreply.github.com>
Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>
Co-authored-by: Daniele Lisi <22307776+danielelisi@users.noreply.github.com>
  • Loading branch information
5 people committed Mar 16, 2023
1 parent 18ab9d8 commit 49a724e
Show file tree
Hide file tree
Showing 163 changed files with 4,972 additions and 18,113 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
include:
- testnet: limanet
testnet_uppercase: LIMANET
- testnet: mumbainet
testnet_uppercase: MUMBAINET
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -72,8 +74,11 @@ jobs:
- protocol: Lima
testnet: limanet
testnet_uppercase: LIMANET
env:
flextesa_docker_image: oxheadalpha/flextesa:latest
flextesa_docker_image: oxheadalpha/flextesa:20221123
- protocol: Mumbai
testnet: mumbainet
testnet_uppercase: MUMBAINET
flextesa_docker_image: oxheadalpha/flextesa:20230203
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -87,18 +92,18 @@ jobs:
# donald,edpkvXGp1BMZxHkwg3mKnWfJYS6HTJ5JtufD8YXxLtH8UKqLZkZVun,tz1eSWp4B9s1qhtNMMNXAkaf2oqCnDHd2iAm,unencrypted:edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2
- name: Generate Flextesa bootstrap accounts
run: |-
echo "alice=$(docker run --rm ${flextesa_docker_image} flextesa key alice)" >> $GITHUB_ENV
echo "bob=$(docker run --rm ${flextesa_docker_image} flextesa key bob)" >> $GITHUB_ENV
echo "charlie=$(docker run --rm ${flextesa_docker_image} flextesa key charlie)" >> $GITHUB_ENV
echo "donald=$(docker run --rm ${flextesa_docker_image} flextesa key donald)" >> $GITHUB_ENV
echo "alice=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key alice)" >> $GITHUB_ENV
echo "bob=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key bob)" >> $GITHUB_ENV
echo "charlie=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key charlie)" >> $GITHUB_ENV
echo "donald=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key donald)" >> $GITHUB_ENV
- name: Provision Flextesa ${{ matrix.protocol }} container
run: |-
docker run \
--rm \
--name my-sandbox \
--detach \
-p 20000:20000 \
${flextesa_docker_image} \
${{ matrix.flextesa_docker_image }} \
flextesa mini-net \
--root /tmp/mini-box --size 1 \
--set-history-mode N000:archive \
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/mondaynet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ jobs:
SSH_KEY: ${{ secrets.MONDAYNET_TORU_SSH_KEY }}
SSH_HOST: ecad-mondaynet-archive

- name: get required TORU contract addresses
id: toru-addresses
run: |
echo '::echo::on'
echo ::set-output name=tx-rollup-hash::$(ssh mondaynet "jq '.[] | select(.name==\"toru_node\") | .value' /srv/tezos/mondaynet_client/tx_rollups | tr -d \\\" ")
echo ::set-output name=tx-rollup-withdraw-contract::$(ssh mondaynet "jq '.[] | select(.name==\"tx_rollup_withdraw_contract\") | .value' /srv/tezos/mondaynet_client/contracts | tr -d \\\" ")
echo ::set-output name=tx-rollup-deposit-contract::$(ssh mondaynet "jq '.[] | select(.name==\"tx_rollup_deposit_contract\") | .value' /srv/tezos/mondaynet_client/contracts | tr -d \\\" ")
echo '::echo::off'
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
Expand All @@ -67,11 +58,8 @@ jobs:
TEZOS_MONDAYNET_TZIP1216CONTRACT_ADDRESS: ${{ steps.originate-contracts-mondaynet.outputs.knownTzip12BigMapOffChainContractAddress }}
TEZOS_MONDAYNET_SAPLINGCONTRACT_ADDRESS: ${{ steps.originate-contracts-mondaynet.outputs.knownSaplingContractAddress }}
TEZOS_MONDAYNET_ON_CHAIN_VIEW_CONTRACT: ${{ steps.originate-contracts-mondaynet.outputs.knownOnChainViewContractAddress }}
TX_ROLLUP_WITHDRAW_CONTRACT: ${{ steps.toru-addresses.outputs.tx-rollup-withdraw-contract }}
TX_ROLLUP_DEPOSIT_CONTRACT: ${{ steps.toru-addresses.outputs.tx-rollup-deposit-contract }}
TX_ROLLUP_TICKETS_OWNER_SECRET: ${{ secrets.TX_ROLLUP_TICKETS_OWNER_SECRET }}
run: npm run test:mondaynet -- --maxWorkers=2
-
-
name: Slack Notification
if: always()
uses: ravsamhq/notify-slack-action@v1
Expand Down
8 changes: 4 additions & 4 deletions apps/taquito-test-dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "taquito-test-dapp-vite",
"private": true,
"version": "15.1.0",
"version": "16.0.0-beta-RC.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -25,9 +25,9 @@
},
"dependencies": {
"@airgap/beacon-sdk": "^3.3.1",
"@taquito/beacon-wallet": "^15.1.0",
"@taquito/taquito": "^15.1.0",
"@taquito/utils": "^15.1.0",
"@taquito/beacon-wallet": "^16.0.0-beta-RC.0",
"@taquito/taquito": "^16.0.0-beta-RC.0",
"@taquito/utils": "^16.0.0-beta-RC.0",
"buffer": "^6.0.3",
"svelte-select": "^4.4.7",
"vite-compatible-readable-stream": "^3.6.1"
Expand Down
42 changes: 42 additions & 0 deletions docs/smart_rollups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Smart Rollups
author: Davis Sawali
---

# Smart Optimistic Rollups

Rollups are a permissionless scaling implementation for the Tezos blockchain. The idea is that anyone can originate and operate one or more rollups, increasing the overall throughput of the Tezos blockchain.

In Taquito, we have implemented some of the operations included in Mumbai protocol update in regards to smart rollups. In this document, we will go through the operations we support. We also won't go too detailed on how rollups work behind the scenes, if you'd like to understand the feature a bit deeper, you can refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html).

## `smart_rollup_add_messages`
The add messages operation allows users to send external messages into a rollup inbox. We will go into a bit more detail down below on what that means.

### Usage
The main use case of sending messages, is usually to denote contract calls. These messages usually takes the form of this object:
```
MESSAGE='[{\
"destination" : "${CONTRACT}", \
"parameters" : "\"Hello world\"", \
"entrypoint" : "default"
}]'
```

If you read closely, the message includes a `destination`, a `parameter`, and an `entrypoint` property. All components needed to **call an entrypoint** of a contract.

These messages can then be claimed back into L1 as a legitimate contract call using the `smart_rollup_execute_outbox_message` operation which we will go over in another section of this doc.

for more information, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message)

### Example
```typescript
const op = await Tezos.contract.smartRollupAddMessages({
message: [
'0000000031010000000b48656c6c6f20776f726c6401bdb6f61e4f12c952f807ae7d3341af5367887dac000000000764656661756c74'
]
});

await op.confirmation();
```

- `message` property receives an array of encoded outbox messages. For more information on how to encode or what message gets encoded, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message)
5 changes: 3 additions & 2 deletions example/deploy-docs-live-code-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { saplingLiveCodeContract } from './data/sapling_live_code_contract';
import { contractMap8pairs } from './data/contractMap8pairs';
import { char2Bytes } from '@taquito/utils';
import { fa2Contract } from '../integration-tests/data/fa2_contract';
import BigNumber from 'bignumber.js';


const provider = 'https://ghostnet.ecadinfra.com/';
Expand Down Expand Up @@ -102,8 +103,8 @@ async function checkBalances(users: string | any[]) {
console.log('checking funds of users...');
try {
for (let i = 0; i < users.length; i++) {
const user_balance: any = await tezos.tz.getBalance(users[i]);
if (user_balance < min_balance) {
const user_balance = await tezos.tz.getBalance(users[i]);
if (user_balance < BigNumber(min_balance)) {
low_balance.push(users[i]);
}
console.log(users[i], user_balance);
Expand Down
4 changes: 2 additions & 2 deletions example/example-streamer-log-time-between-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { PollingSubscribeProvider, TezosToolkit } from '@taquito/taquito';
// To run this script, run the following command in the example folder: `npm run example:streamer-block-time`
// This script polls on the head block at an interval of `pollingIntervalMilliseconds`.
// When a new block is seen, the time between the new block and the precedent is logged with the block level
// If a block is missed when polling, 'Missed block: `level`' is logged.
// If a block is missed when polling, 'Missed block: `level`' is logged.

const provider = 'https://ghostnet.ecadinfra.com';
const pollingIntervalMilliseconds = 5000;
let date: Date;
let level: number;

function logLevelAndTime(data: any) {
function logLevelAndTime(data: number) {
const newDate = new Date();
const timeBetweenBlocks = date ? (newDate.getTime() - date.getTime()) : 0;
if (level && data - level > 1) {
Expand Down
6 changes: 3 additions & 3 deletions example/example-streamer.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { PollingSubscribeProvider, TezosToolkit } from '@taquito/taquito';

async function example() {
const provider = 'https://mainnet.api.tez.ie/';
const provider = 'https://ghostnet.ecadinfra.com/';
const tezos = new TezosToolkit(provider)
tezos.setStreamProvider(tezos.getFactory(PollingSubscribeProvider)({ shouldObservableSubscriptionRetry: true, pollingIntervalMilliseconds: 15000 }));
try {

const bakerEndorsementFilter = {
and: [{ source: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'endorsement' }]
and: [{ source: 'tz1bQMn5xYFbX6geRxqvuAiTywsCtNywawxH' }, { kind: 'endorsement' }]
}

const bakerDelegation = {
and: [{ destination: 'tz2TSvNTh2epDMhZHrw73nV9piBX7kLZ9K9m' }, { kind: 'delegation' }]
and: [{ destination: 'tz1bQMn5xYFbX6geRxqvuAiTywsCtNywawxH' }, { kind: 'delegation' }]
}

const sub = tezos.stream.subscribeOperation({
Expand Down
22 changes: 11 additions & 11 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@taquito/example",
"private": true,
"version": "15.1.0",
"version": "16.0.0-beta-RC.0",
"scripts": {
"example": "node -r ts-node/register --preserve-symlinks example-node.ts",
"example:activation": "node -r ts-node/register --preserve-symlinks example-activate.ts",
Expand Down Expand Up @@ -41,16 +41,16 @@
},
"dependencies": {
"@ledgerhq/hw-transport-node-hid": "^6.27.3",
"@taquito/ledger-signer": "^15.1.0",
"@taquito/local-forging": "^15.1.0",
"@taquito/michel-codec": "^15.1.0",
"@taquito/michelson-encoder": "^15.1.0",
"@taquito/rpc": "^15.1.0",
"@taquito/sapling": "^15.1.0",
"@taquito/signer": "^15.1.0",
"@taquito/taquito": "^15.1.0",
"@taquito/tzip16": "^15.1.0",
"@taquito/utils": "^15.1.0",
"@taquito/ledger-signer": "^16.0.0-beta-RC.0",
"@taquito/local-forging": "^16.0.0-beta-RC.0",
"@taquito/michel-codec": "^16.0.0-beta-RC.0",
"@taquito/michelson-encoder": "^16.0.0-beta-RC.0",
"@taquito/rpc": "^16.0.0-beta-RC.0",
"@taquito/sapling": "^16.0.0-beta-RC.0",
"@taquito/signer": "^16.0.0-beta-RC.0",
"@taquito/taquito": "^16.0.0-beta-RC.0",
"@taquito/tzip16": "^16.0.0-beta-RC.0",
"@taquito/utils": "^16.0.0-beta-RC.0",
"bignumber.js": "^9.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion example/scan-path-ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ async function example() {
}
}

example();
example();
Loading

0 comments on commit 49a724e

Please sign in to comment.