diff --git a/.github/workflows/manual-deploy-obscuro-gateway-database.yml b/.github/workflows/manual-deploy-obscuro-gateway-database.yml index 8fe3faaeb2..af448b43e7 100644 --- a/.github/workflows/manual-deploy-obscuro-gateway-database.yml +++ b/.github/workflows/manual-deploy-obscuro-gateway-database.yml @@ -88,7 +88,7 @@ jobs: && sudo apt-get install -y gcc \ && sudo snap refresh && sudo snap install --channel=1.18 go --classic \ && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \ - && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/obscuronet/go-obscuro.git /home/obscuro/go-obscuro \ + && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ && docker network create --driver bridge node_network || true \ && docker run -d --name datadog-agent \ --network node_network \ diff --git a/.github/workflows/manual-deploy-obscuro-gateway.yml b/.github/workflows/manual-deploy-obscuro-gateway.yml index 5e95506e53..e1f08b7131 100644 --- a/.github/workflows/manual-deploy-obscuro-gateway.yml +++ b/.github/workflows/manual-deploy-obscuro-gateway.yml @@ -104,7 +104,7 @@ jobs: && sudo apt-get install -y gcc \ && sudo snap refresh && sudo snap install --channel=1.18 go --classic \ && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \ - && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/obscuronet/go-obscuro.git /home/obscuro/go-obscuro \ + && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ && docker network create --driver bridge node_network || true \ && docker run -d --name datadog-agent \ --network node_network \ diff --git a/.github/workflows/manual-deploy-obscuro-scan-2.yml b/.github/workflows/manual-deploy-obscuro-scan-2.yml index 5433288240..aea11d479e 100644 --- a/.github/workflows/manual-deploy-obscuro-scan-2.yml +++ b/.github/workflows/manual-deploy-obscuro-scan-2.yml @@ -63,7 +63,7 @@ jobs: name: ${{ github.event.inputs.testnet_type }}-fe-obscuro-scan location: 'uksouth' restart-policy: 'Never' - environment-variables: VITE_APIHOSTADDRESS=http://${{ github.event.inputs.testnet_type }}-api-obscuro-scan.uksouth.azurecontainer.io VITE_FE_VERSION=${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }} + environment-variables: VITE_APIHOSTADDRESS=https://${{ github.event.inputs.testnet_type }}-api.obscuroscan.io VITE_FE_VERSION=${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }} command-line: npm run serve-prod ports: '80' cpu: 2 diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 97c48e8a98..14dd0f91a8 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -202,7 +202,7 @@ jobs: az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ --command-id RunShellScript \ --scripts 'mkdir -p /home/obscuro \ - && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/obscuronet/go-obscuro.git /home/obscuro/go-obscuro \ + && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ && docker network create --driver bridge node_network || true \ && docker run -d --name datadog-agent \ --network node_network \ @@ -344,9 +344,9 @@ jobs: - name: 'Send a repository dispatch to obscuro-test on deployment of dev-testnet' if: ${{ (github.event.inputs.testnet_type == 'dev-testnet') }} run: | - curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/obscuronet/obscuro-test/dispatches --data '{ "event_type": "dev_testnet_deployed", "client_payload": { "ref": "${{ github.ref_name }}" }' + curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/ten-protocol/ten-test/dispatches --data '{ "event_type": "dev_testnet_deployed", "client_payload": { "ref": "${{ github.ref_name }}" }' - name: 'Send a repository dispatch to obscuro-test on deployment of testnet' if: ${{ (github.event.inputs.testnet_type == 'uat-testnet') }} run: | - curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/obscuronet/obscuro-test/dispatches --data '{ "event_type": "uat_testnet_deployed", "client_payload": { "ref": "${{ github.ref_name }}" }' + curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/ten-protocol/ten-test/dispatches --data '{ "event_type": "uat_testnet_deployed", "client_payload": { "ref": "${{ github.ref_name }}" }' diff --git a/.github/workflows/manual-upgrade-testnet-l2.yml b/.github/workflows/manual-upgrade-testnet-l2.yml index 562e386289..bc7e313976 100644 --- a/.github/workflows/manual-upgrade-testnet-l2.yml +++ b/.github/workflows/manual-upgrade-testnet-l2.yml @@ -147,7 +147,7 @@ jobs: docker pull ${{ vars.L2_HOST_DOCKER_BUILD_TAG }} \ && docker pull ${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ && rm -rf /home/obscuro/go-obscuro \ - && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/obscuronet/go-obscuro.git /home/obscuro/go-obscuro \ + && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ && cd /home/obscuro/go-obscuro/ \ && sudo go run /home/obscuro/go-obscuro/go/node/cmd \ -is_genesis=${{ matrix.is_genesis }} \ @@ -212,12 +212,12 @@ jobs: - name: 'Send a repository dispatch to obscuro-test on upgrade of dev-testnet' if: ${{ github.event.inputs.testnet_type == 'dev-testnet' }} run: | - curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/obscuronet/obscuro-test/dispatches --data '{ "event_type": "dev_testnet_upgraded", "client_payload": { "ref": "${{ github.ref_name }}" }' + curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/ten-protocol/ten-test/dispatches --data '{ "event_type": "dev_testnet_upgraded", "client_payload": { "ref": "${{ github.ref_name }}" }' - name: 'Send a repository dispatch to obscuro-test on upgrade of uat-testnet' if: ${{ github.event.inputs.testnet_type == 'uat-testnet' }} run: | - curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/obscuronet/obscuro-test/dispatches --data '{ "event_type": "uat_testnet_upgraded", "client_payload": { "ref": "${{ github.ref_name }}" }' + curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/ten-protocol/ten-test/dispatches --data '{ "event_type": "uat_testnet_upgraded", "client_payload": { "ref": "${{ github.ref_name }}" }' obscuro-test-signal-on-schedule: runs-on: ubuntu-latest @@ -228,4 +228,4 @@ jobs: steps: - name: 'Send a repository dispatch to obscuro-test on upgrade of dev-testnet' run: | - curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/obscuronet/obscuro-test/dispatches --data '{ "event_type": "dev_testnet_upgraded", "client_payload": { "ref": "${{ github.ref_name }}" }' + curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/ten-protocol/ten-test/dispatches --data '{ "event_type": "dev_testnet_upgraded", "client_payload": { "ref": "${{ github.ref_name }}" }' diff --git a/.github/workflows/on-merged-pr.yml b/.github/workflows/on-merged-pr.yml index 6ad171ece8..55d82af192 100644 --- a/.github/workflows/on-merged-pr.yml +++ b/.github/workflows/on-merged-pr.yml @@ -12,5 +12,5 @@ jobs: steps: - name: 'Trigger obscuro-test local testnet tun' run: | - curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/obscuronet/obscuro-test/dispatches --data '{ "event_type": "merged_pull_request", "client_payload": { "number": ${{ github.event.number }}, "owner": "${{ github.event.pull_request.user.login }}" } }' + curl -XPOST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Accept:application/vnd.github" -H "Content-Type:application/json" https://api.github.com/repos/ten-protocol/ten-test/dispatches --data '{ "event_type": "merged_pull_request", "client_payload": { "number": ${{ github.event.number }}, "owner": "${{ github.event.pull_request.user.login }}" } }' \ No newline at end of file diff --git a/README.md b/README.md index 685b53f384..53dda54b4f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Go Obscuro +# Go Ten -This repository contains the reference implementation of the [Obscuro Protocol](https://whitepaper.obscu.ro/). +This repository contains the reference implementation of the [Ten Protocol](https://whitepaper.obscu.ro/). *Note that this is still very much a work in progress, so there are many rough edges and unfinished components.* @@ -14,14 +14,14 @@ The typical blockchain node runs multiple services in a single process. For exam - Mempool - etc -Obscuro uses Trusted Execution Environments (TEE), like Intel SGX, to execute transactions in a confidential environment, which means we diverge from the typical architecture. +Ten uses Trusted Execution Environments (TEE), like Intel SGX, to execute transactions in a confidential environment, which means we diverge from the typical architecture. There are three main components of the architecture, each running as a separate process: the Enclave, the Host and the Wallet Extension. ![Architecture](design/architecture/resources/obscuro_arch.jpeg) ### I. The Enclave -This is the core component of Obscuro which runs inside the TEE. +This is the core component of Ten which runs inside the TEE. See [go/enclave](go/enclave) We use [EGo](https://www.edgeless.systems/products/ego/), an open source SDK for developing this confidential component. @@ -31,7 +31,7 @@ The Enclave exposes an [interface](go/common/enclave.go) over RPC which attempts The Enclave component has these main responsibilities: #### 1. Execute EVM transactions -Obscuro has the goal to be fully compatible with the EVM, so smart contracts can be ported freely from other EVM compatible +Ten has the goal to be fully compatible with the EVM, so smart contracts can be ported freely from other EVM compatible chains. To achieve this and minimise the effort and incompatibilities, we depend on [go-ethereum](https://github.com/ethereum/go-ethereum). The dependency on go-ethereum is not straight forward, since transaction execution is coupled with Ethereum specific consensus rules, @@ -59,10 +59,10 @@ See [go/enclave/db](go/enclave/db) #### 3. Consume Ethereum blocks The Enclave is fed Ethereum blocks through the RPC interface. These blocks are used as the "Source of Truth", and the Enclave extracts useful information from them, such as published rollups, deposits to the bridge, etc. Ethereum re-orgs have to be detected -at this level to rollback the Obscuro state accordingly. +at this level to rollback the Ten state accordingly. To avoid the risk of the Enclave being fed invalid blocks which an attacker can use to probe for information, or to shorten the -[revelation period](https://whitepaper.obscu.ro/obscuro-whitepaper/detailed-design.html#revelation-mechanism), the blocks have to be checked for validity, which includes checking that enough "work" went into them. +[revelation period](https://whitepaper.obscu.ro/ten-whitepaper/detailed-design.html#revelation-mechanism), the blocks have to be checked for validity, which includes checking that enough "work" went into them. To achieve this we depend on the [Blockchain](https://github.com/ethereum/go-ethereum/blob/e6fa102eb08c2b83ab75e85ca7860eea3a10dab0/core/blockchain.go) logic. @@ -70,20 +70,20 @@ logic. #### 4. Bridge to Ethereum One of the key aspects of Ethereum Layer 2 (L2) solutions is to feature a decentralised bridge that is resistant to 51% attacks. -Obscuro features a L2 side of the bridge that is completely under the control of the platform. +Ten features a L2 side of the bridge that is completely under the control of the platform. ##### a) Deposits During processing of the Ethereum blocks, the platform generates synthetic L2 transactions based on every relevant transaction found there. -For example when Alice deposits 10ABC from her account to the L1 bridge, Obscuro will execute a synthetic L2 transaction (that it deterministically -generated from the L1 transaction), which moves 10WABC from the L2 bridge to Alice's address on Obscuro. +For example when Alice deposits 10ABC from her account to the L1 bridge, Ten will execute a synthetic L2 transaction (that it deterministically +generated from the L1 transaction), which moves 10WABC from the L2 bridge to Alice's address on Ten. -This logic is part of the consensus of Obscuro, every node receiving the same block containing the rollup and the deposits, will generate the exact same synthetic transaction. +This logic is part of the consensus of Ten, every node receiving the same block containing the rollup and the deposits, will generate the exact same synthetic transaction. ##### b) Withdrawals -Obscuro ERC20 transactions sent to a special "Bridge" address are interpreted as withdrawals. Which means the wrapped tokens are burned -on the Obscuro side of the bridge and a Withdrawal instruction is added to the rollup header, which will be later executed by the Ethereum side of the bridge. +Ten ERC20 transactions sent to a special "Bridge" address are interpreted as withdrawals. Which means the wrapped tokens are burned +on the Ten side of the bridge and a Withdrawal instruction is added to the rollup header, which will be later executed by the Ethereum side of the bridge. -This happens deterministically in a post-processing phase, after all Obscuro transactions were executed by the EVM. +This happens deterministically in a post-processing phase, after all Ten transactions were executed by the EVM. See [go/enclave/bridge](go/enclave/bridge) @@ -109,7 +109,7 @@ included in a rollup.* #### 6. The rollups and the PoBI protocol Like in any blockchain the unit of the protocol is the batch of transactions organized in a chain. -The Obscuro blocks have an encrypted payload, which is only visible inside the secure Enclave. +The Ten blocks have an encrypted payload, which is only visible inside the secure Enclave. All of the logic of maintaining the current state based on incoming data and of producing new rollups is found in the [go/enclave/rollupchain](go/enclave/rollupchain) package. @@ -123,13 +123,13 @@ These are the main components: ##### a) RPC encryption/decryption -The Obscuro "Wallet extension" encrypts all requests from users (transactions or smart contract method calls) with the "Obscuro public key", which is a key derived from the +The Ten "Wallet extension" encrypts all requests from users (transactions or smart contract method calls) with the "Ten public key", which is a key derived from the master seed. The response is in turn encrypted with the "Viewing Key" of the requesting user. This component manages viewing keys and handles the encryption and decryption. -The transactions received from users are gossiped with the other aggregators encrypted with the "Obscuro Public Key". +The transactions received from users are gossiped with the other aggregators encrypted with the "Ten Public Key". *Note: In the current implementation, this key is hardcoded.* @@ -181,7 +181,7 @@ building blocks of the Enclave* The missing link to achieving fully private transactions while allowing end-users to continue using their favourite wallets (like MetaMask). This is a very thin component that is responsible for encrypting and decrypting traffic -between the Obscuro node and its clients. +between the Ten node and its clients. See the [docs](https://docs.obscu.ro/wallet-extension/wallet-extension/) for more information. @@ -197,17 +197,17 @@ root │ ├── enclave: The component that is loaded up inside SGX. │ │ ├── bridge: The platform side of the decentralised bridge logic. │ │ ├── core: Base data structures used only inside the enclave. -│ │ ├── crypto: Implementation of the Obscuro cryptography. +│ │ ├── crypto: Implementation of the Ten cryptography. │ │ ├── db: The database implementations. │ │ ├── enclaverunner: The entry point to the standalone enclave process. -│ │ ├── evm: Obscuro transaction execution on top of the EVM. +│ │ ├── evm: Ten transaction execution on top of the EVM. │ │ ├── main: Main │ │ ├── mempool: The mempool living inside the enclave │ │ ├── rollupchain: The main logic for calculating the state and the POBI protocol. │ │ └── rpcencryptionmanager: Responsible for encrypting the communication with the wallet extension. │ ├── ethadapter: Responsible for interpreting L1 transactions │ │ ├── erc20contractlib: Understand ERC20 transactions. -│ │ └── mgmtcontractlib: Understand Obscuro Management contrract transactions. +│ │ └── mgmtcontractlib: Understand Ten Management contrract transactions. │ ├── host: The standalone host process. │ │ ├── db: The host's database. │ │ ├── hostrunner: The entry point. @@ -220,28 +220,28 @@ root │ │ └── enclaverpc: The RPC client for communications with the enclave. │ ├── rpcclientlib: Library to allow go applications to connect to a host via RPC. │ └── wallet: Logic around wallets. Used both by the node, which is an ethereum wallet, and by the tests -├── integration: Integration tests that spin up Obscuro networks. +├── integration: Integration tests that spin up Ten networks. │ ├── simulation: A series of tests that simulate running networks with different setups. ├── testnet: Utilities for deploying a testnet. └── tools: Peripheral tooling. ├── hardhatdeployer: Automates deployment of ERC20 and management contracts to the L1. ├── faucet: Faucet for testnet. - ├── obscuroscan: Tooling to monitor network transactions. - └── walletextension: Ensures sensitive messages to and from the Obscuro node are encrypted. + ├── tenscan: Tooling to monitor network transactions. + └── walletextension: Ensures sensitive messages to and from the Ten node are encrypted. ## Testing -The Obscuro integration tests are found in: [integration/simulation](integration/simulation). +The Ten integration tests are found in: [integration/simulation](integration/simulation). The main tests are "simulations", which means they spin up both an L1 network and an L2 network, and then inject random transactions. Due to the non-determinism of both the "mining" protocol in the L1 network and the nondeterminism of POBI, coupled with the random traffic, it allows the tests to capture many corner cases without having to explicitly write individual tests for them. The first [simulation_in_mem_test](integration/simulation/simulation_in_mem_test.go) runs fully in one single process on top of a -mocked L1 network and with the networking components of the Obscuro node swapped out, and is just focused on producing +mocked L1 network and with the networking components of the Ten node swapped out, and is just focused on producing random L1 blocks at very short intervals. The [ethereummock](integration/ethereummock) implementation is based on the ethereum protocol with the individual nodes gossiping with each other with random latencies, producing blocks at a random interval distributed around a configured ``AvgBlockDuration``, and making decisions about the canonical head based on the longest chain. @@ -255,7 +255,7 @@ The [simulation_geth_in_mem_test](integration/simulation/simulation_geth_in_mem_ network of geth nodes started in clique mode. The lowest unit of time of producing blocks in that mode is `1 second`. The [simulation_full_network_test](integration/simulation/simulation_full_network_test.go) starts standalone local processes for -both the enclave and the obscuro node connected to real geth nodes. +both the enclave and the ten node connected to real geth nodes. The [simulation_docker_test](integration/simulation/simulation_docker_test.go) goes a step further and runs the enclave in "Simulation mode" in a docker container with the "EGo" library. @@ -269,10 +269,10 @@ of these setups by receiving RPC handles to the nodes. ## Getting Started -The following section describes building the reference implementation of the Obscuro protocol, running the unit and -integration tests, and deploying a local testnet for end-to-end testing. The reference implementation of Obscuro is +The following section describes building the reference implementation of the Ten protocol, running the unit and +integration tests, and deploying a local testnet for end-to-end testing. The reference implementation of Ten is written in [go](https://go.dev). Unless otherwise stated, all paths stated herein are relative to the root of the -`go-obscuro` checkout. +`go-ten` checkout. ### Dependencies @@ -303,7 +303,7 @@ is used and the creation of the docker images automated as described in [Buildin ### Running the tests -The tests require an Obscuro enclave to be locally running, and as such the image should first be created and added to the +The tests require an Ten enclave to be locally running, and as such the image should first be created and added to the docker images repository. Building the image is described in [dockerfiles](dockerfiles) and can be performed using the below in the root of the project; @@ -325,7 +325,7 @@ docker images repository use; ``` ./testnet/testnet-local-build_images.sh \ && go run ./testnet/launcher/cmd \ -&& ./testnet/start-obscuroscan.sh --rpcServerAddress=http://localhost:80 --receivingPort=8098 +&& ./testnet/start-tenscan.sh --rpcServerAddress=http://localhost:80 --receivingPort=8098 ``` The above will perform all the relevant builds and ensure the images are ready for running each component. @@ -334,28 +334,28 @@ Will then start each component with the alloted defaults. ~3-6 mins to complete The defaults used are: - `0x13E23Ca74DE0206C56ebaE8D51b5622EFF1E9944` is the public address of the pre-funded account on the L1 network used -to deploy the Obscuro Management and the ERC20 contracts +to deploy the Ten Management and the ERC20 contracts - `0x0654D8B60033144D567f25bF41baC1FB0D60F23B` is the public address of the pre-funded account on the L1 network used to -pay for Obscuro rollup transactions +pay for Ten rollup transactions - `f52e5418e349dccdda29b6ac8b0abe6576bb7713886aa85abea6181ba731f9bb` is the private key of the pre-funded -account on the L1 network used to deploy the Obscuro Management and the ERC20 contracts -- `0x0000000000000000000000000000000000000001` is the host id of the Obscuro node when starting in a local mode -- `0xeDa66Cc53bd2f26896f6Ba6b736B1Ca325DE04eF` is the address of the Obscuro Management contract which is known a-priori as a nonce of 0 is used -- `0xC0370e0b5C1A41D447BDdA655079A1B977C71aA9` is the address of the ERC20 contract which represents OBX and is known a-priori as a nonce of 1 is used +account on the L1 network used to deploy the Ten Management and the ERC20 contracts +- `0x0000000000000000000000000000000000000001` is the host id of the Ten node when starting in a local mode +- `0xeDa66Cc53bd2f26896f6Ba6b736B1Ca325DE04eF` is the address of the Ten Management contract which is known a-priori as a nonce of 0 is used +- `0xC0370e0b5C1A41D447BDdA655079A1B977C71aA9` is the address of the ERC20 contract which represents TEN and is known a-priori as a nonce of 1 is used - `0x51D43a3Ca257584E770B6188232b199E76B022A2` is the address of the ERC20 contract which represents ETH and is known a-priori as a nonce of 2 is used -Once started Obscuroscan is available on `http://0.0.0.0:8098`. +Once started Tenscan is available on `http://0.0.0.0:8098`. ### Building and running a local faucet -Deploying and interacting with contracts on Obscuro requires ETH to be allocated to an account on the L2 via the faucet (or bridged across from the L1). +Deploying and interacting with contracts on Ten requires ETH to be allocated to an account on the L2 via the faucet (or bridged across from the L1). The faucet image should be pulled (or optionally built from scratch), and the container built and started to allow requests to be made to it. To pull the testnet faucet and run use; ``` cd tools/faucet docker pull testnetobscuronet.azurecr.io/obscuronet/faucet_sepolia_testnet:latest -./container_run.sh -image testnetobscuronet.azurecr.io/obscuronet/faucet_sepolia_testnet:latest +./container_run.sh -image testnetobscuronet.azurecr.io/obscuronet/faucet_sepolia_testnet:latest ``` The faucet runs a web server within the container, with a port mapping of 8080 set to allow POST requests to be made to @@ -370,12 +370,12 @@ curl --location --request POST 'http://127.0.0.1:8080/fund/eth' \ ### Deploying contracts into a local testnet -Deploying and interacting with contracts on Obscuro requires the wallet extension to be running. The wallet extension is -the Obscuro component that ensures that sensitive information in RPC requests between client applications and Obscuro +Deploying and interacting with contracts on Ten requires the wallet extension to be running. The wallet extension is +the Ten component that ensures that sensitive information in RPC requests between client applications and Ten cannot be seen by third parties. The wallet extension should be run local to the client application and is described in more detail at [docs/wallet-extension/wallet-extension.md](docs/wallet-extension/wallet-extension.md). -To start the wallet extension to run against a local testnet, in the go-obscuro repo use the below; +To start the wallet extension to run against a local testnet, in the go-ten repo use the below; ``` cd ./tools/walletextension/main/ diff --git a/contracts/README.md b/contracts/README.md index d020f6c32b..3e4a2081b6 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -1,6 +1,6 @@ -# Obscuro smart contracts +# Ten smart contracts -This hardhat project contains the relevant smart contracts for the Obscuro L2 platform. +This hardhat project contains the relevant smart contracts for the Ten L2 platform. ## Dependencies @@ -32,13 +32,13 @@ Additionally you can pass the `noCompile` flag which will disable running the co ### Deployment Scripts folder structure - * core - Scripts required to be predeployed for Obscuro to start. + * core - Scripts required to be predeployed for Ten to start. * bridge - Scripts that deploy/upgrade ONLY the bridge. * messenger - Scripts that enable the relayer functionality. Can contain predeployed libraries too in the future. * testnet - Scripts that should only be deployed on the testnet. Tokens, "dev tooling" scripts, etc. -For deployments, we use the hardhat-deploy plugin. It provides the `deploy` task, which determines what folders with deployment scripts need to be executed for the current selected network. Additionally there is the `obscuro:deploy` task that will launch a wallet extension. -For the wallet extension to work, the network needs to have configured the `url` to 127.0.0.1:3000 and the additional `obscuroEncRpcUrl` property to the rpc endpoint of the obscuro node the wallet will connect to. +For deployments, we use the hardhat-deploy plugin. It provides the `deploy` task, which determines what folders with deployment scripts need to be executed for the current selected network. Additionally there is the `ten:deploy` task that will launch a wallet extension. +For the wallet extension to work, the network needs to have configured the `url` to 127.0.0.1:3000 and the additional `tenEncRpcUrl` property to the rpc endpoint of the ten node the wallet will connect to. Scripts are taken from `deployment_scripts` and executed in alphabetic order. Each folder, as ordered in the network config and then inside of it alphabetically. Notice that `func.dependencies = []` defined in deployment functions has the ability to escape the default ordering. If such a deployment function/script is reached, the deploy plugin will first deploy its dependency if it hasn't already. diff --git a/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts b/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts index 8c8c425f92..2fdab0fba0 100644 --- a/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts +++ b/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts @@ -18,7 +18,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // Deploy a constant supply (constructor mints) erc20 await deployments.execute('ObscuroBridge', { from: deployer - }, 'promoteToAdmin', '0xE09a37ABc1A63441404007019E5BC7517bE2c43f') + }, 'promoteToAdmin', '0xE09a37ABc1A63441404007019E5BC7517bE2c43f'); + + await deployments.execute('ObscuroBridge', { + from: deployer + }, 'promoteToAdmin', '0xeC3f9B38a3B30AdC9fB3dF3a0D8f50127E6c2C8f'); }; export default func; diff --git a/contracts/src/README.md b/contracts/src/README.md index ca65af03c9..5c858ab6b8 100644 --- a/contracts/src/README.md +++ b/contracts/src/README.md @@ -1,7 +1,7 @@ ## Solidity smart contracts In this subdirectory you can find the solidity smart contracts for the platform. -Under the `/management` subdirectory you can find the root contract of Obscuro - ManagementContract.sol +Under the `/management` subdirectory you can find the root contract of Ten - ManagementContract.sol It dictates the possible state of the Layer 2 and drives the process. Under `/messaging` you can find the cross chain messaging contracts. Inside of it under the `/messenger` subdirectory sits an example implementation of cross chain message relayer that utilizes the message bus. diff --git a/design/README.md b/design/README.md index c16a9f1d1e..4ac7ca164e 100644 --- a/design/README.md +++ b/design/README.md @@ -1,6 +1,6 @@ -# Obscuro design documents +# Ten design documents -Obscuro started based on a (whitepaper)[https://whitepaper.obscu.ro/] published in Nov. 2021. +Ten started based on a (whitepaper)[https://whitepaper.obscu.ro/] published in Nov. 2021. As we started development, we started thinking more deeply about some aspects and also getting feedback from the community and the users. @@ -25,7 +25,7 @@ Note: the wallet extension and the data relevancy rules are already implemented. ## Bridge -Obscuro needs a decentralised bridge infrastructure to Ethereum. +Ten needs a decentralised bridge infrastructure to Ethereum. Note: this design is approved and mostly implemented (there are some dependencies on the fast-finality work). @@ -40,7 +40,7 @@ Note: the design is approved, and currently it is being implemented. ## Security, Privacy and Cryptography -Obscuro is a decentralised Ethereum Layer 2 that aims to maintain privacy. +Ten is a decentralised Ethereum Layer 2 that aims to maintain privacy. We need to design the cryptography that keeps data private. Like any software system, it needs to be upgradeable, which is more difficult with our constraints. diff --git a/design/architecture/overall_design.md b/design/architecture/overall_design.md index 1afbdb6662..adf98da79e 100644 --- a/design/architecture/overall_design.md +++ b/design/architecture/overall_design.md @@ -1,24 +1,24 @@ -# Obscuro design +# Ten design ## Scope -The purpose of this document is to describe aspects of Obscuro's technical design that are not addressed in the -[Obscuro whitepaper](https://whitepaper.obscu.ro/). +The purpose of this document is to describe aspects of Ten's technical design that are not addressed in the +[Ten whitepaper](https://whitepaper.obscu.ro/). ## Overview -The following diagram shows the key components of an Obscuro deployment: +The following diagram shows the key components of an Ten deployment: ![architecture diagram](./resources/obscuro_arch.jpeg) The Ethereum node and Ethereum chain components shown in this diagram are developed and maintained by third-parties. The following additional components must be developed: -* **The enclave:** The trusted part of the Obscuro node that runs inside a trusted execution environment (TEE) -* **The host:** The remainder of the Obscuro node that runs outside the TEE -* **The Obscuro management contract:** The Ethereum mainnet contracts required by the Obscuro protocol, described - [here](https://whitepaper.obscu.ro/obscuro-whitepaper/l1-contracts) -* **Client apps:** Applications that interact with the Obscuro node (e.g. Obscuro wallets) +* **The enclave:** The trusted part of the Ten node that runs inside a trusted execution environment (TEE) +* **The host:** The remainder of the Ten node that runs outside the TEE +* **The Ten management contract:** The Ethereum mainnet contracts required by the Ten protocol, described + [here](https://whitepaper.obscu.ro/ten-whitepaper/l1-contracts) +* **Client apps:** Applications that interact with the Ten node (e.g. Ten wallets) ## Host/enclave split @@ -50,7 +50,7 @@ The host has a lot of responsibilities, including: - serving requests for data and transaction submissions - feeding data to the enclave to keep it up-to-date with the L1 and L2 networks - publishing secret request/responses and (for the sequencer) rollups to the L1 network -- receiving and publishing Obscuro data (e.g. batches and mempool transactions) with peer nodes +- receiving and publishing Ten data (e.g. batches and mempool transactions) with peer nodes - managing failover and recovery for the enclave for high-availability (HA) nodes The host will be organised with a variety of services to manage these responsibilities. diff --git a/design/architecture/tech_decisions.md b/design/architecture/tech_decisions.md index c897f1dae3..cdcea1562b 100644 --- a/design/architecture/tech_decisions.md +++ b/design/architecture/tech_decisions.md @@ -1,12 +1,12 @@ # Tech decisions -This document lists the frameworks and tooling used by Obscuro. +This document lists the frameworks and tooling used by Ten. The purpose of this list is to avoid the proliferation of different frameworks and tooling with the same general -purpose, as this increases the developer overhead when extending Obscuro. +purpose, as this increases the developer overhead when extending Ten. The introduction of a new framework or tool should be discussed with the team, even if the usage sits outside the -`go-obscuro` repo. +`go-ten` repo. ## Deployment diff --git a/design/bridge/bridge_design.md b/design/bridge/bridge_design.md index 0e05fd1517..38e1240f04 100644 --- a/design/bridge/bridge_design.md +++ b/design/bridge/bridge_design.md @@ -1,10 +1,10 @@ -# Obscuro Cross Chain Messaging And Initial Bridge - Design Document +# Ten Cross Chain Messaging And Initial Bridge - Design Document -We want to expose a system API that allows any developer to come and build a bridge on Obscuro. We also want this API to support all types of well known bridges - wrapping assets, liquidity bridges, etc. And ideally we want the system API to further allow even more exotic type of apps - providing randomness to the L1, hidden game state and anything other that can be enabled as a cross chain application! +We want to expose a system API that allows any developer to come and build a bridge on Ten. We also want this API to support all types of well known bridges - wrapping assets, liquidity bridges, etc. And ideally we want the system API to further allow even more exotic type of apps - providing randomness to the L1, hidden game state and anything other that can be enabled as a cross chain application! With the API we will build an initial bridge that wraps assets and might progress this further. -The API design proposal is inspired by the [Wormhole protocol](https://wormhole.com/). The idea is we would allow for authenticated messaging between Layer 1 and Layer 2 on Obscuro through a smart contract API available on both layers. +The API design proposal is inspired by the [Wormhole protocol](https://wormhole.com/). The idea is we would allow for authenticated messaging between Layer 1 and Layer 2 on Ten through a smart contract API available on both layers. It will be provided by two smart contracts deployed on network creation on both layers. These contracts will be owned by the ManagementContract and the enclave on their respective layers. @@ -13,7 +13,7 @@ These contracts will be owned by the ManagementContract and the enclave on their ## Requirements 1. **High Level Requirements** - * The Obscuro platform provides On-Chain system APIs that allow dApp developers to build cross-chain bridges and applications. + * The Ten platform provides On-Chain system APIs that allow dApp developers to build cross-chain bridges and applications. * Users should be able to transmit authenticated data between L1 & L2. Example Message: ```json { @@ -23,32 +23,32 @@ These contracts will be owned by the ManagementContract and the enclave on their } ``` * As an L2 developer I want to be able to query specific message topics coming from specific addresses. - * The Obscuro gas calculation should include the L1 fees of submitting a message that originates on the L2. Users should fully cover the storage fees and the Rollup publisher should not incur any financial loss. + * The Ten gas calculation should include the L1 fees of submitting a message that originates on the L2. Users should fully cover the storage fees and the Rollup publisher should not incur any financial loss. * The messaging and bridge are decentralized as much as possible. * Block reorganizations should have no impact on the security of the messaging protocol and the downstream apps that use this protocol. 2. **Bridge Requirements** - * The reference bridge contracts should be completely ordinary and separate from the management contract; The API should expose all the messaging pieces of information required in order to build the bridge independently from Obscuro - * The bridge will have an asset whitelist controlled and configured by the management contract. Later this will be managed by the Obscuro DAO. + * The reference bridge contracts should be completely ordinary and separate from the management contract; The API should expose all the messaging pieces of information required in order to build the bridge independently from Ten + * The bridge will have an asset whitelist controlled and configured by the management contract. Later this will be managed by the Ten DAO. * Assets and their wrapped L2 counterparts should be mapped and exposed for querying. * Bridge functionality should be able to use the [pull payment](https://docs.openzeppelin.com/contracts/2.x/api/payment#PullPayment) design. - > If any current dApps want to extend or port their functionality on Obscuro then it should be possible for them to do it without collaborating with anyone else + > If any current dApps want to extend or port their functionality on Ten then it should be possible for them to do it without collaborating with anyone else ## Scope -* Messaging architecture between Obscuro and Mainnet Ethereum. +* Messaging architecture between Ten and Mainnet Ethereum. * Basic Bridge that wraps assets * Primitive fees implementation ## Assumptions 1. Fees - * Big assumption - there will be a way to pay for bridge services/messaging in OBX without incurring losses in ETH on the layer 1 side. - * The Obscuro DAO will be able to configure properties for the messaging part of the protocol and accurately estimate the `gas costs` of storing data without losing too much on `gas price` spikes. + * Big assumption - there will be a way to pay for bridge services/messaging in TEN without incurring losses in ETH on the layer 1 side. + * The Ten DAO will be able to configure properties for the messaging part of the protocol and accurately estimate the `gas costs` of storing data without losing too much on `gas price` spikes. 2. Finality * The management contract will be responsible for not exposing data that has not been finalized. This means that it should have first gone through the challenge period. * The Rollup protocol will ensure the L1 blocks being consumed by the enclave and the resulting synthetic transactions are always bound to the blocks generating them. - * Obscuro has fast finality over the transaction ordering rather than the results. When a deposit gets reorganized the results on Obscuro L2 should reorganize too if depending on it. + * Ten has fast finality over the transaction ordering rather than the results. When a deposit gets reorganized the results on Ten L2 should reorganize too if depending on it. ## Modifications @@ -57,9 +57,9 @@ The Rollup headers right now are assumed to include withdrawal instructions. The ## Definitions -* `System contract` - A contract that is deployed by the Obscuro protocol when the Layer 2 network is created. System contracts serve the purpose of providing system API access on-chain. +* `System contract` - A contract that is deployed by the Ten protocol when the Layer 2 network is created. System contracts serve the purpose of providing system API access on-chain. -## MessageBus Design - Obscuro cross-chain data transmission +## MessageBus Design - Ten cross-chain data transmission The `MessageBus` will be deployed as a [`Proxy`](https://docs.openzeppelin.com/contracts/4.x/api/proxy) @@ -129,7 +129,7 @@ Any contract or user can call the `publishMessage` function. Any message passed `consistencyLevel` is a mechanism to introduce delay before the message is considered valid. The platform will only expose the message after the block producing it is confirmed by blocks equal to the `consistencyLevel` -> **_NOTE:_** `consistencyLevel` is only required if Obscuro does not reorganize when L1 deposits reorganize. In other instances it can be set to 0 or 1. There is however another use case for it described in [Security](#MessageBusSecurity). +> **_NOTE:_** `consistencyLevel` is only required if Ten does not reorganize when L1 deposits reorganize. In other instances it can be set to 0 or 1. There is however another use case for it described in [Security](#MessageBusSecurity). ### Verify Message @@ -152,7 +152,7 @@ Internally, the function will hash the message and compare it with the result of ### Submit Out Of Network Messages -This is the smart contract function which is used to store messages sent from the other linked layer. The function will be called by the `ManagementContract` on L1 and the `enclave` on L2. It should be access controlled and called according to the `consistencyLevel` and Obscuro platform rules. +This is the smart contract function which is used to store messages sent from the other linked layer. The function will be called by the `ManagementContract` on L1 and the `enclave` on L2. It should be access controlled and called according to the `consistencyLevel` and Ten platform rules. ```solidity function submitOutOfNetworkMessage( @@ -164,7 +164,7 @@ function submitOutOfNetworkMessage( ) public onlyRole(ADMINISTRATOR|OWNER) ``` -This function should not be callable by any users or contracts unless they have the `ADMINISTRATOR` role or are the `Owner` of the `MessageBus` contract. Along with those requirements, on the Obscuro layer 2, there is an additional security measure - Any incoming transaction to this function is blocked, even if it is coming from an address that has the correct role. The protocol will block transactions that do not originate from inside of the enclave due to consuming L1 blocks. This means that even if the enclave gets hacked and the keys leak the verifiers will block withdraws. +This function should not be callable by any users or contracts unless they have the `ADMINISTRATOR` role or are the `Owner` of the `MessageBus` contract. Along with those requirements, on the Ten layer 2, there is an additional security measure - Any incoming transaction to this function is blocked, even if it is coming from an address that has the correct role. The protocol will block transactions that do not originate from inside of the enclave due to consuming L1 blocks. This means that even if the enclave gets hacked and the keys leak the verifiers will block withdraws. When called, the function should store the message indexed in storage - map of `senders` that contains a map of `topics` which points to array of `messages` should be sufficient. Along with it, the hash of the whole message should be used as a key to store a message received flag inside the map `receivedMessages`. This map enables quick verification that a message is valid and received. @@ -196,37 +196,37 @@ When a block from `L1` is processed by the `enclave` and transactions inside of When a transaction on the `L2` results in `LogMessagePublished`, the event will automatically be added to the `Rollup header` by the `enclave`. Then the management contract will submit them to the `MessageBus` or they will directly be. -![Diagram not found](./resources/PublishFromObscuro.svg) +![Diagram not found](./resources/PublishFromTen.svg) -> **_NOTE:_** **The messages must not be accessible unless** the challenge period has passed! On top of that the block where the message is submitted to L1 must have confirmations equal to `consistencyLevel` before the message is released. Those are simply counted on-chain as "confirmations" is meaningless for Obscuro L2. +> **_NOTE:_** **The messages must not be accessible unless** the challenge period has passed! On top of that the block where the message is submitted to L1 must have confirmations equal to `consistencyLevel` before the message is released. Those are simply counted on-chain as "confirmations" is meaningless for Ten L2. ### Alternative approaches -1. Obscuro only ever pushes the hash of the message. The user has the responsibility of providing the full message which will only be accepted if it matches one of the hashes, if neccessary. +1. Ten only ever pushes the hash of the message. The user has the responsibility of providing the full message which will only be accepted if it matches one of the hashes, if neccessary. * This simplifies gas cost calculations, but the problem described in the `Fees` section remains. * Contracts can hash their messages before passing them to the `MessageBus` and achieve nearly the same outcome if they want to. -2. Obscuro only pushes to L2. Messages on L1 are provided signed by the enclave through an RPC and the MessageBus contract verifies that they have been signed by a correct enclave-owned key. +2. Ten only pushes to L2. Messages on L1 are provided signed by the enclave through an RPC and the MessageBus contract verifies that they have been signed by a correct enclave-owned key. * This disabled the option to read messages and ordering becomes problematic. * The API is different between layers, which might end up being a bad UX. ### Fees -When publishing a message on the Obscuro L2, storing the message will have a direct cost to the `Sequencer` who is publishing the Rollup in the form of gas. In order to channel this cost to the user who is publishing the message we would need some configurable properties. +When publishing a message on the Ten L2, storing the message will have a direct cost to the `Sequencer` who is publishing the Rollup in the form of gas. In order to channel this cost to the user who is publishing the message we would need some configurable properties. -**Assumption: Obscuro DAO** will vote and set the following properties: +**Assumption: Ten DAO** will vote and set the following properties: * `fixedMessageStoringCost` - this is the gas cost for storing the fixed-size properties of the message * `dynamicCostPerByte` - this is the gas cost per byte for storing the dinamically sized data - `bytes payload`, `bytes topic` -> **_NOTE:_** This whole section might change based on the outcome of the Obscuro fees & rewards design. It only outlines a potential solution. +> **_NOTE:_** This whole section might change based on the outcome of the Ten fees & rewards design. It only outlines a potential solution. -The wormhole implementation requires that a fee is paid for each published message. This is something we should implement exactly as is to prevent people from spamming huge messages on L2 for a little gas cost that results in Obscuro having to pay for them being submitted to the L1! +The wormhole implementation requires that a fee is paid for each published message. This is something we should implement exactly as is to prevent people from spamming huge messages on L2 for a little gas cost that results in Ten having to pay for them being submitted to the L1! -The problem we will experience is that the native currency on Obscuro L2 will be different from the native currency on L1 - ETH. This means `ETH : OBX` pair volatility might result in losing money on gas costs. +The problem we will experience is that the native currency on Ten L2 will be different from the native currency on L1 - ETH. This means `ETH : TEN` pair volatility might result in losing money on gas costs. I see a couple of possible solutions to this: 1. Collect the fees in `WETH` when calling `publishMessage`. * This is a bad user experience. Anytime we want to withdraw we must source `WETH` * It does protect us from losing money when publishing rollups, however. -2. Using a DEX when it becomes available on Obscuro's L2 we can exchange OBX tokens for the required amount of `WETH`. +2. Using a DEX when it becomes available on Ten's L2 we can exchange TEN tokens for the required amount of `WETH`. An additional insurance fee might be required. It is described in [Security](#MessageBusSecurity) @@ -234,7 +234,7 @@ An additional insurance fee might be required. It is described in [Security](#Me ### Security -The security of the `MessageBus` is maintained by the `ManagementContract` and the enclave. When the `MessageBus` is secure, then all the downstream apps are secure too. **The maximum achievable security depends on the type of finality the Obscuro L2 has.** +The security of the `MessageBus` is maintained by the `ManagementContract` and the enclave. When the `MessageBus` is secure, then all the downstream apps are secure too. **The maximum achievable security depends on the type of finality the Ten L2 has.** * For probabilistic finality - We can be fully secure as L1 block reorgs will reorganize us too. * Fast & hard finality - Block reorgs can lead to instances of the enclave having delivered a message that got thrown away, even when accounting for confirmations. @@ -265,7 +265,7 @@ This diagrams should help illustrate the control flow: We can also engineer a mechanism to insure delivered messages: * When fees are collected for `publishMessage`, part of those fees is funneled to an insurance pool. -* When a message that has been published gets reorganized the ObscuroDAO can pay for the financial loss from the insurance pool. +* When a message that has been published gets reorganized the TenDAO can pay for the financial loss from the insurance pool. > **_NOTE:_** The maximum possible payout should always be less than the penalty for PoS slashing on MainNet. This ensures there is no profit to attacking and claiming insurance. @@ -310,11 +310,11 @@ There will be the following topics initially: --- -**Diagram of the bridge process that happens on Obscuro's Layer 2 when a deposit is created** -![Sequence Diagram not available](./resources/ObscuroL2_MessageBus_deposit_Diagram.svg) +**Diagram of the bridge process that happens on Ten's Layer 2 when a deposit is created** +![Sequence Diagram not available](./resources/TenL2_MessageBus_deposit_Diagram.svg) -**Diagram of the process to withdraw the assets from the bridge contract on Obscuro's Layer 2** -![Sequence Diagram not available](./resources/ObscuroL2_Bridge_withdraw_Diagram.svg) +**Diagram of the process to withdraw the assets from the bridge contract on Ten's Layer 2** +![Sequence Diagram not available](./resources/TenL2_Bridge_withdraw_Diagram.svg) The API to transfer assets from the perspective of the user is the same on both layers. The process is as follows: @@ -360,5 +360,5 @@ The security of the `MessageBus` guarantees that downstream dApps using it are a ## Decentralization -The `MessageBus` and `Bridge` contracts sit on-chain and inherit the least common denominator properties of both Obscuro and Eth. If Obscuro is decentralized then the Bridge and MessageBus will be too. +The `MessageBus` and `Bridge` contracts sit on-chain and inherit the least common denominator properties of both Ten and Eth. If Ten is decentralized then the Bridge and MessageBus will be too. diff --git a/design/finality_protocol/Soft_finality_guarantee.md b/design/finality_protocol/Soft_finality_guarantee.md index 7093f874e2..fe580895ef 100644 --- a/design/finality_protocol/Soft_finality_guarantee.md +++ b/design/finality_protocol/Soft_finality_guarantee.md @@ -12,10 +12,10 @@ Note: See bridge and finality designs for more details ## Problem and Requirements The central sequencer is mainly responsible for the ordering (sequencing) of the L2 transactions. -The ordering of the L1 transactions like the deposits into the Obscuro bridge, is decided by the Ethereum staking nodes, +The ordering of the L1 transactions like the deposits into the Ten bridge, is decided by the Ethereum staking nodes, governed by the PoS Consensus. -Given that deposits affect the balances of accounts, which can be used in Obscuro transactions, there is a dependence +Given that deposits affect the balances of accounts, which can be used in Ten transactions, there is a dependence between the ordering of the L1 messages and the result of executing L2 transactions. In the "fast finality" design, the "soft finality" of an L2 transaction is defined as the moment when the sequencer produces @@ -42,9 +42,9 @@ factors unlikely to happen unless there is a re-org attack. Messages from the L1 are processed as they are found in the L1 blocks, and synthetic transactions are generated based on them. These synthetic transactions are implicitly included in the light batches. -A "synthetic transaction" is a transaction generated by the Obscuro protocol from some external data, with the intent of -bringing that data on the Obscuro chain, since these transactions will be addressed to a "system contract". -Every Obscuro node, given the same input data, will generate the same synthetic transactions, and thus correctly verify +A "synthetic transaction" is a transaction generated by the Ten protocol from some external data, with the intent of +bringing that data on the Ten chain, since these transactions will be addressed to a "system contract". +Every Ten node, given the same input data, will generate the same synthetic transactions, and thus correctly verify the state root of each rollup. @@ -64,11 +64,11 @@ There are two main disadvantages. The first is that users must wait before bridge messages are processed, which is not a great UX and it disables certain applications. The second is that the security of the funds on the bridge depends on the delay. If the delay is x Ethereum blocks, then -an attacker must wait for x blocks until the deposit executes on Obscuro, and then perform a revert attack on Ethereum. +an attacker must wait for x blocks until the deposit executes on Ten, and then perform a revert attack on Ethereum. Note that with PoS, if the delay is 64 blocks (2 epochs), then re-org is mostly a theoretical possibility, because in practice it is prohibitively expensive for anyone. -The subtlety of this approach is that it can transform Obscuro into a side-chain even though we roll up to Ethereum. +The subtlety of this approach is that it can transform Ten into a side-chain even though we roll up to Ethereum. This depends on the definition of an L2, which is a moving target. If the consensus is that an L2 needs a re-org resistant bridge, then this option will break it. diff --git a/design/finality_protocol/fast_finality.md b/design/finality_protocol/fast_finality.md index 2fdd843ceb..cd5b620e5e 100644 --- a/design/finality_protocol/fast_finality.md +++ b/design/finality_protocol/fast_finality.md @@ -14,7 +14,7 @@ described in the [Bootstrapping Strategy design doc](./sequencer_bootstrapping_s * Enclaves can be hacked; a signature from an attested enclave cannot be taken as an absolute proof that an attacker does not have control over the enclave's execution -* The market does not sufficiently trust the Obscuro foundation to allow it to run the sequencer unchecked; we +* The market does not sufficiently trust the Ten foundation to allow it to run the sequencer unchecked; we therefore need some validation of its execution to provide assurance * The adoption of the sequencer model may be long-lived, and must therefore be fully production ready * The enclave has a start-up delay that exceeds the production time for batches (see below) @@ -59,7 +59,7 @@ described in the [Bootstrapping Strategy design doc](./sequencer_bootstrapping_s * Censorship resistance * If censorship-resistance is achieved through an L1 inbox mechanism, it is acceptable for the costs of the - associated L1 transactions (which will be greater than the Obscuro costs) to fall on the transaction submitter + associated L1 transactions (which will be greater than the Ten costs) to fall on the transaction submitter * Resilience * During failover, upgrade or planned maintenance of the sequencer, it is acceptable to break the one-second soft-finality guarantee, and drop transactions that have not been soft-finalised (see e.g. @@ -267,7 +267,7 @@ identify value-extraction opportunities. #### Do nothing In this approach, we rely on trust in the sequencer and the fact that value-extraction opportunities are reduced in -Obscuro due to its data-visibility rules. +Ten due to its data-visibility rules. #### Disable `eth_call` on sequencer enclaves diff --git a/design/finality_protocol/sequencer_bootstrapping_strategy.md b/design/finality_protocol/sequencer_bootstrapping_strategy.md index be83e10801..74763326eb 100644 --- a/design/finality_protocol/sequencer_bootstrapping_strategy.md +++ b/design/finality_protocol/sequencer_bootstrapping_strategy.md @@ -2,24 +2,24 @@ *Note: this document is still a WIP* -As we are getting closer to production and have already designed implemented the key components of Obscuro, it's time to think about our bootstrapping strategy. +As we are getting closer to production and have already designed implemented the key components of Ten, it's time to think about our bootstrapping strategy. The POBI protocol described in the whitepaper assumes a network with significant traction. -To get there, we estimate Obscuro will need at least one year, most likely more. +To get there, we estimate Ten will need at least one year, most likely more. Other things we have to take into consideration during bootstrapping is code maturity and security. In the industry, this is called a period where the "training wheels" are on. The other major L2 networks (Arbitrum and Optimism), opted for a pragmatic approach where they started out with a centralised sequencer. -We propose that Obscuro starts out similarly to the L2s. Centralised block production and decentralised validation. +We propose that Ten starts out similarly to the L2s. Centralised block production and decentralised validation. ## Single block producer This is in essence a very simplified "POBI" with a single aggregator (SA). -The SA is operated by the Obscuro Foundation, and is configured as a variable in the Obscuro Management Contract (MC) on Ethereum. +The SA is operated by the Ten Foundation, and is configured as a variable in the Ten Management Contract (MC) on Ethereum. Only the foundation has the power to set the designated SA. Note that this means that the "Consensus problem" becomes relatively simple in this first stage. @@ -107,7 +107,7 @@ In the first stage we'll rely on trust that the SA will operate correctly, mostl ### Requirements of a Protocol for fast finality -If we wouldn't have to worry about scalability, or if Obscuro functioned like transparent chains, then the SA could just emit events and receipts when it processes a tx, +If we wouldn't have to worry about scalability, or if Ten functioned like transparent chains, then the SA could just emit events and receipts when it processes a tx, and send them to a caching layer to be consumed by clients. Also, the state could be cached, so that "eth_call" requests could be handled from the caching layer. @@ -124,7 +124,7 @@ The solution is to delegate the work of replying to users to the entire network #### Incentives for L2 node operators -See the incentives design in go-obscuro. +See the incentives design in go-ten. #### Proposal for a protocol to keep L2 nodes in sync @@ -154,7 +154,7 @@ After N such light rounds, when the Aggregator has gathered enough txs, it submi ##### The batch as the canonical unit -In the scenario, from the point of view of the ObscuroVM, each batch is the equivalent to an Ethereum block. +In the scenario, from the point of view of the TenVM, each batch is the equivalent to an Ethereum block. The rollups published to the L1 function more like logical checkpoints. diff --git a/design/scratchpad/Design_escape_hatch.md b/design/scratchpad/Design_escape_hatch.md index a2f88c767d..30861a6a0f 100644 --- a/design/scratchpad/Design_escape_hatch.md +++ b/design/scratchpad/Design_escape_hatch.md @@ -1,9 +1,9 @@ -# Design for the Obscuro escape hatch +# Design for the Ten escape hatch *Note: this document is still a WIP* This document proposes a design for an "Escape Hatch". -It describes the ultimate way by which users can exit Obscuro. +It describes the ultimate way by which users can exit Ten. ## High level requirement @@ -11,7 +11,7 @@ It describes the ultimate way by which users can exit Obscuro. The "escape hatch" is the mechanism that kicks in when **all hope is lost**, the last resort. Something that happens just before the network goes down permanently for some unforseen reason. -For example, wen the central sequencer is no longer able to produce blocks and the Obscuro foundation is unable to replace it with something working in due time. +For example, wen the central sequencer is no longer able to produce blocks and the Ten foundation is unable to replace it with something working in due time. The high level requirement is that even in this situation, users should be able to exit the funds they have locked up in the bridge. diff --git a/design/security/Escape_hatch.md b/design/security/Escape_hatch.md index 001d58a8d6..4ecfaf75ec 100644 --- a/design/security/Escape_hatch.md +++ b/design/security/Escape_hatch.md @@ -1,7 +1,7 @@ ## Handling catastrophic events -Obscuro is facing more risk than a transparent network during unforeseen situations. +Ten is facing more risk than a transparent network during unforeseen situations. With traditional software, if a bug prevents all nodes from starting up, the developers can quickly fix the bug, release the version, and the network will proceed. This works because there are no visibility restrictions on the existing data. As long as the data is not corrupted beyond recovery, there is always a path forward. @@ -45,7 +45,7 @@ Ideally, a mechanism that relies on verifying digital signatures and Merkle Tree To reduce the scope of abuse, we propose that, during phase 1, only the sequencer can enter "Safe mode". -Upgrade proof signed by an ad-hoc "upgrade oracle" composed of most of the Obscuro node operators at the time +Upgrade proof signed by an ad-hoc "upgrade oracle" composed of most of the Ten node operators at the time of each version. The public keys of all these nodes will be included in the image. diff --git a/design/security/Source_of_truth.md b/design/security/Source_of_truth.md index 5b9bd8268d..929e2a396f 100644 --- a/design/security/Source_of_truth.md +++ b/design/security/Source_of_truth.md @@ -1,6 +1,6 @@ -# An objective source of truth for the Obscuro Enclave +# An objective source of truth for the Ten Enclave -A TEE-based network like Obscuro needs a reliable and objective source of truth to function correctly and protect the +A TEE-based network like Ten needs a reliable and objective source of truth to function correctly and protect the data privacy in the face of complex attacks by the node operator. ## Problems @@ -12,13 +12,13 @@ The lack of reliable source-of-truths mechanisms can lead to the following types Note: we will analyse each of these attacks below. -Obscuro is an Ethereum Layer 2, so it is natural to consider the Ethereum chain as the source of truth. +Ten is an Ethereum Layer 2, so it is natural to consider the Ethereum chain as the source of truth. The transition to proof-of-stake is making the problem even more difficult because one of the tradeoffs made when designing that protocol was to weaken the objectivity assumption to "Weak subjectivity". ### Revelation period -Obscuro has a built-in mechanism to reveal encryption keys for transactions after a configured amount of time. +Ten has a built-in mechanism to reveal encryption keys for transactions after a configured amount of time. The difficulty is how to measure time reliably inside an enclave. When Ethereum was based on proof-of-work, we could rely on the number of Ethereum blocks that have been consumed by the enclave @@ -33,13 +33,13 @@ challenging. The threat is that a hacker learns about an SGX vulnerability after there is already a patch available and wants to use compromised hardware on a snapshot of the network state to decrypt the historical data. -Note: Obscuro reveals data anyway, so the impact of such an attack in real life would be reduced, but we need to make our best effort to keep +Note: Ten reveals data anyway, so the impact of such an attack in real life would be reduced, but we need to make our best effort to keep the guarantee of the revelation period. -### Transparent Obscuro Upgrades +### Transparent Ten Upgrades -A TEE-based system like Obscuro must be upgradeable. +A TEE-based system like Ten must be upgradeable. During an upgrade, the new software version must be able to pick up from the old version, which means that the previous version must share some of its secrets with the new version. @@ -100,7 +100,7 @@ an upgrade in a dark room without anyone knowing. In phase 2, we can decentralise by creating a more complex incentive-driven lifecycle. 1. A developer proposes a new version by publishing a GitHub tag (hash) and the Attestation of an enclave built from that code, - together with a stake. Initially, the developer will likely be the Obscuro Foundation. + together with a stake. Initially, the developer will likely be the Ten Foundation. 2. Anyone posting a stake can make a challenge to this version. The challenge period is predetermined. @@ -129,7 +129,7 @@ This mechanism has several advantages: #### Transparent upgrades conclusion -Obscuro will implement the transparent, smart-contract-driven upgrade process, starting out with the centralised approach and then decentralising in the next phase. +Ten will implement the transparent, smart-contract-driven upgrade process, starting out with the centralised approach and then decentralising in the next phase. The design needs two key ingredients: 1. The enclave must understand the outputs of the smart contract. @@ -291,8 +291,8 @@ Note: These are still unreviewed draft proposals at this stage. #### Solution 1 - Batched publishing to Bitcoin -The naive solution described above is inefficient because every single Obscuro node has to periodically publish a transaction to Bitcoin. -One immediate improvement is for the Obscuro nodes to join forces and generate shared randomness (`SR`) during a cycle, +The naive solution described above is inefficient because every single Ten node has to periodically publish a transaction to Bitcoin. +One immediate improvement is for the Ten nodes to join forces and generate shared randomness (`SR`) during a cycle, and then someone publishes this `SR` to Bitcoin. This achieves the same result, as it convinces every enclave that participated in this cycle that its timestamp is valid. @@ -322,10 +322,10 @@ Q1: why would someone aggregate these nonces? Find incentives Q2: what exactly is published, by whom, why? Incentives -#### Solution 2 - Nonce validated by the Obscuro network +#### Solution 2 - Nonce validated by the Ten network -Another potential solution is to rely on the Obscuro network itself to validate the randomness. -This is more tricky to achieve because of the subjectivity of the Obscuro network participants. +Another potential solution is to rely on the Ten network itself to validate the randomness. +This is more tricky to achieve because of the subjectivity of the Ten network participants. ##### Protocol @@ -333,7 +333,7 @@ Draft: Every N Ethereum epoch started, the enclave will generate a payload containing a newly generated nonce, the last checkpoint hash, and the current Attestation. -The host is responsible for collecting signatures from the other Obscuro nodes over this payload. +The host is responsible for collecting signatures from the other Ten nodes over this payload. The rule is that an enclave receiving a request from another enclave will sign over it only if the latest checkpoint coincides, and the Attestation is valid. @@ -350,7 +350,7 @@ sign over a payload that points to an unknown or a past epoch. After a couple of The most difficult problem with this approach is establishing the validity of the confirmation signatures themselves. In the hypothetical "long-range" scenario where the attacker spins up an enclave on a snapshot of a database from 6 months ago, -the Obscuro nodes that this enclave considers active might no longer be. +the Ten nodes that this enclave considers active might no longer be. If these nodes are decommissioned, then they will not respond, so the attack will fail quickly. The problem comes when we assume the attacker now controls these servers. To perform the attack, they must all be in synch and respond to each other. diff --git a/design/security/Upgrade_Design.md b/design/security/Upgrade_Design.md index a519e050c7..e051d61384 100644 --- a/design/security/Upgrade_Design.md +++ b/design/security/Upgrade_Design.md @@ -1,7 +1,7 @@ -# Obscuro Upgrades +# Ten Upgrades -This design covers the operational aspects of upgrading Obscuro. -The mechanism by which the community validates an upgrade is covered in the [Obscuro source of truth](./Source_of_truth.md) document. +This design covers the operational aspects of upgrading Ten. +The mechanism by which the community validates an upgrade is covered in the [Ten source of truth](./Source_of_truth.md) document. We'll start by identifying the types of scenarios that will require a software upgrade, and next, we'll propose the procedures and the technical changes required to achieve them. @@ -10,16 +10,16 @@ Note: This document is written with the single aggregator model, but it also app ## Prerequisites -Upgradeability is a very complex topic. We'll start by listing the concerns specific to Obscuro and by creating +Upgradeability is a very complex topic. We'll start by listing the concerns specific to Ten and by creating some useful classifications to be able to reason about the problems. -### Obscuro secrets +### Ten secrets -There are two main secrets on an Obscuro node : +There are two main secrets on an Ten node : 1. The master seed, aka "the shared secret", is the basis of all communication between enclaves, users and enclaves, and data availability on Ethereum. 2. The key for connecting to the local database, which lives in its enclave. - - Note: Obscuro uses EdgelessDB, a modified MySQL running inside an enclave. The connection to the database is made using a key generated during the setup phase of the enclave. The EdgelessDB enclave ensures that only the owner of that key can read data. + - Note: Ten uses EdgelessDB, a modified MySQL running inside an enclave. The connection to the database is made using a key generated during the setup phase of the enclave. The EdgelessDB enclave ensures that only the owner of that key can read data. Access to these secrets will allow attackers to read private user data. Both secrets are sealed locally with a key derived from the current measurement of the enclave. @@ -36,11 +36,11 @@ can connect to the same database if it passes the attestation requirements it ha - The privacy of the ledger data is guaranteed by the security of the local secrets. - The main reason for a "privacy" upgrade is the discovery of a vulnerability that can leak data. - Most upgrades will hopefully be for mundane reasons such as new features or general improvements. -- Obscuro is an L2 with a governance mechanism on the Ethereum Management Contract (MC). The decisions made by +- Ten is an L2 with a governance mechanism on the Ethereum Management Contract (MC). The decisions made by the governance contract must be understood and enforced by the enclave. See more details in the "Source_of_truth.md" document. -## Upgrade reasons for Obscuro +## Upgrade reasons for Ten 1. To fix security bugs which can impact the integrity of the ledger. 1. To fix security bugs that can impact the ledger's privacy. @@ -87,7 +87,7 @@ They can implement the change such that the previous version does not crash when There are multiple issues with this option. It was used mostly in the early days, but currently, the "hard fork" approach with a block number activation date is the preferred option. -In Obscuro, we'll use the preferred Ethereum approach. +In Ten, we'll use the preferred Ethereum approach. ### 2. Local only upgrades @@ -99,7 +99,7 @@ This version can be installed by a node operator at any time and is optional. ### 3. Privacy related upgrades -This type of upgrade specific to Obscuro (or other privacy networks) is necessary to remove a side channel or another avenue where data can be leaked. +This type of upgrade specific to Ten (or other privacy networks) is necessary to remove a side channel or another avenue where data can be leaked. This is not a "consensus upgrade" in the traditional sense, but it has to be treated equally because if there is a single node operator with a vulnerable version on the network, then privacy is considered compromised. @@ -110,7 +110,7 @@ After the rollout of such an upgrade, it is mandatory to change the secrets. Upgrading the SGX firmware or completely changing hardware falls under the same category. -## Obscuro architecture +## Ten architecture In this section, we'll look at the architecture and analyse how upgrading different components fits into the above categories. @@ -122,7 +122,7 @@ Any change to this codebase must go through the attestation whitelisting process Note that some changes can be "local only", such as a release containing only a performance improvement. -Note that Obscuro will allow multiple approved versions in the period between two block heights. +Note that Ten will allow multiple approved versions in the period between two block heights. ### Host @@ -131,8 +131,8 @@ Some upgrades could also be consensus upgrades, for example, on a change of prot ### The Wallet extension -End users install this component that communicates with Obscuro nodes via RPC. -For a good UX, Obscuro nodes must be backwards compatible and support even older versions of the Wallet extension. +End users install this component that communicates with Ten nodes via RPC. +For a good UX, Ten nodes must be backwards compatible and support even older versions of the Wallet extension. There must be warnings and mechanisms to help users upgrade to the latest version. @@ -247,7 +247,7 @@ this luxury. Without a mechanism put in place in the initial release, the enclave cannot be upgraded at all because any other version will not be able to read the data. -Upgradability in phase 1 is only a concern for the Obscuro enclave, as upgrading the "Host" component can be designed afterwards. +Upgradability in phase 1 is only a concern for the Ten enclave, as upgrading the "Host" component can be designed afterwards. ### High-level tasks @@ -350,7 +350,7 @@ further reduce the chance of the same error happening everywhere. ### Joining the network -There will be mechanisms in place to prevent users from starting a non-current version of an Obscuro Node. +There will be mechanisms in place to prevent users from starting a non-current version of an Ten Node. These mechanisms are necessary to prevent exploiting of already fixed privacy vulnerabilities. This means that a node joining the network must do so with the latest version which must contain all the compatibility modes diff --git a/design/security/cryptography.md b/design/security/cryptography.md index 37dc3724a1..e6a4495386 100644 --- a/design/security/cryptography.md +++ b/design/security/cryptography.md @@ -1,6 +1,6 @@ -# Obscuro cryptography +# Ten cryptography -Obscuro uses cryptography for: +Ten uses cryptography for: - data authentication - integrity - Private communication and data storage. @@ -27,7 +27,7 @@ will get verified by the other nodes who have the power to challenge. ## Private communication and data storage -Privacy is a concern that is Obscuro-specific. +Privacy is a concern that is Ten-specific. For protecting data-in-use we use SGX. @@ -36,7 +36,7 @@ In this section we'll discuss how data is protected in transit and at rest. ### The Shared Secret -Obscuro is a decentralised network of attested nodes that need to collaborate on building a ledger. +Ten is a decentralised network of attested nodes that need to collaborate on building a ledger. The ledger should only be visible inside the enclave program, and not to the outside world. The requirement is that all data exiting the enclaves should be encrypted with keys known only to the enclaves. @@ -58,16 +58,16 @@ and for receiving encrypted responses which only that user can decrypt. VKs are signed by the actual account key as part of a transaction. This is the only step that requires a human interaction. -VKs are certificates used behind the scenes by the Obscuro tooling to encrypt and authenticate traffic. +VKs are certificates used behind the scenes by the Ten tooling to encrypt and authenticate traffic. ### Data in transit By data in transit, we mean a few things: - transactions submitted by end users. - "eth_call" requests. Users calling smart contracts -- protocol communication between obscuro nodes (not yet used, so not covered). +- protocol communication between ten nodes (not yet used, so not covered). -#### The "Obscuro Key" +#### The "Ten Key" Client software must encrypt data with a key known only to the enclaves. @@ -87,9 +87,9 @@ Data at rest is: #### EdgelessDB -Obscuro uses EdglessDB as the local database, the equivalent of LevelDB in go-ethereum. +Ten uses EdglessDB as the local database, the equivalent of LevelDB in go-ethereum. -EdgelessDB runs inside an enclave. After the initial handshake attestation, the Obscuro Enclave will store the key +EdgelessDB runs inside an enclave. After the initial handshake attestation, the Ten Enclave will store the key used for communication with Edgeless sealed with the enclave key. Edb uses RocksDB behind the scenes and use AES-GCM to encrypt the backing files. @@ -115,17 +115,17 @@ The advantage of releasing keys, as opposed to releasing decrypted transactions #### Storing transactions in batches -Batches are the units of data gossiped between the Obscuro nodes that provide soft finality. +Batches are the units of data gossiped between the Ten nodes that provide soft finality. The payload of each batch is encrypted with a: `Key_for_Batch(Batch_Height)=HKDF(SHA256(BatchHeight || Shared_secret))` (Todo - does this make sense?) ## SGX Attestation Parameters -In order for the Obscuro enclave to be considered secure, besides the actual code running on up-to-date hardware, it also must be +In order for the Ten enclave to be considered secure, besides the actual code running on up-to-date hardware, it also must be configured with the right parameters. -The requirement is that a node operator should not be able to start an Obscuro Enclave (and obtain the Shared Secret) with +The requirement is that a node operator should not be able to start an Ten Enclave (and obtain the Shared Secret) with parameters that allow them to extract secrets. Some configs will not change from one version to the nex, but must be configurable because the same codebase is used for both testing and production. @@ -137,7 +137,7 @@ The config file passed in will be included in the enclave measurement. ### Protected config parameters #### Business configs -- Obscuro Chain Id +- Ten Chain Id - Ethereum Chain Id - Management Contract Address - MessageBus Address diff --git a/design/security/high_availability.md b/design/security/high_availability.md index d09aabc1a6..73634d74e5 100644 --- a/design/security/high_availability.md +++ b/design/security/high_availability.md @@ -1,6 +1,6 @@ # High availability -The Obscuro Sequencer must have HA capabilities. The reasoning is covered in the "Fast finality" design docs. +The Ten Sequencer must have HA capabilities. The reasoning is covered in the "Fast finality" design docs. The requirement is that the service must continue even if the enclave of the sequencer crashes and is corrupted. @@ -12,14 +12,14 @@ between them to ensure that service goes on uninterrupted. ## MEV Protection -The Sequencer is the only Obscuro node capable of producing Light Batches, and thus the only node that can in theory +The Sequencer is the only Ten node capable of producing Light Batches, and thus the only node that can in theory attempt to extract value via MEV. If the operator has multiple enclaves available operating in "Sequencer" mode it can both provide an uninterrupted service and extract some value at the same time. Introducing startup delays does not help too much in this case, because the operator could hold key transactions for longer. -An alternative solution is to introduce transparency into the lifecycle events of the sequencer enclaves, such that the Obscuro network +An alternative solution is to introduce transparency into the lifecycle events of the sequencer enclaves, such that the Ten network can assess the likelyhood of bad behaviour. Lifecycle events: @@ -60,7 +60,7 @@ Todo - each event points to the previous event to prevent the operator from tran ? Periodically (todo - how often? Every batch?), the sequencer host will request a `RestartEvent` from each of the whitelisted enclaves it controls. -It will add these events to the `ProtocolPayload`, and broadcast them to the Obscuro network together with the Batch. +It will add these events to the `ProtocolPayload`, and broadcast them to the Ten network together with the Batch. Upon restart, each enclave records the required data as a variable, and will return that variable in the right struct each time it is being asked. This proof cannot be forged without a significant bug in the software or impersonation of the enclave. diff --git a/design/security/randomness_design.md b/design/security/randomness_design.md index 3036bc80a1..e9c5effc49 100644 --- a/design/security/randomness_design.md +++ b/design/security/randomness_design.md @@ -1,8 +1,8 @@ -# Randomness in Obscuro design +# Randomness in Ten design ## Scope -The purpose of this document is to describe how randomness is generated and exposed to Obscuro smart contracts. +The purpose of this document is to describe how randomness is generated and exposed to Ten smart contracts. ## Overview @@ -10,7 +10,7 @@ In the latest version of Ethereum, smart contract developers generally use the ` This randomness is visible and known to everyone, and somehow under the control of the miners. ## Requirements -In Obscuro, our goal is to remove any control that the miners might have over randomness, while also keeping the randomness private per transaction. +In Ten, our goal is to remove any control that the miners might have over randomness, while also keeping the randomness private per transaction. This enables use cases such as games with hidden state. ## Solution diff --git a/design/ux/Events_design.md b/design/ux/Events_design.md index b48a461805..444ef55464 100644 --- a/design/ux/Events_design.md +++ b/design/ux/Events_design.md @@ -1,8 +1,8 @@ -# Events in Obscuro - Design document +# Events in Ten - Design document ## Scope -This is a design proposal for how to handle events in Obscuro. +This is a design proposal for how to handle events in Ten. It covers two aspects: @@ -23,7 +23,7 @@ It covers two aspects: ## Event visibility design -In Obscuro, we aim to maintain the same events APIs that are found in Ethereum, and will try to implement privacy +In Ten, we aim to maintain the same events APIs that are found in Ethereum, and will try to implement privacy concerns with as few changes as possible. For background on how Ethereum handles events, see the section "Background - Ethereum Events Design", below. @@ -38,7 +38,7 @@ To decide whether a user Alice is entitled to view an event, we must consider th ### Event visibility rules -Each event contains an array of 32-byte hex strings, called topics. In Obscuro, as in Ethereum, end-users are +Each event contains an array of 32-byte hex strings, called topics. In Ten, as in Ethereum, end-users are identified by one or more account addresses. Since we are reusing Ethereum's API without modifications, our goal is to use an event's topics to ascertain who the event is relevant to, with users able to see an event if and only if the event is considered relevant to them. @@ -77,10 +77,10 @@ be used for subscribing. As the ultimate flexible mechanism we propose a programmatic way to determine whether a requester is allowed to view an event. If the implicit rules are not satisfactory, the smart contract developer can define a view function called -``eventVisibility``, which will be called by the Obscuro VM behind the scenes. +``eventVisibility``, which will be called by the Ten VM behind the scenes. ```solidity - // If declared in a smart contract, this function will be called by the Obscuro VM to determine whether the requester + // If declared in a smart contract, this function will be called by the Ten VM to determine whether the requester // address is allowed to view the event. function eventVisibility(address requester, bytes32[] memory topics, bytes32[] memory data) external view returns (bool){ // based on the data from the event, passed in as an array of topic and data (which is the internal VM representation) @@ -91,7 +91,7 @@ If the implicit rules are not satisfactory, the smart contract developer can def } ``` -To determine the visibility of an event, the Obscuro VM will do the following: +To determine the visibility of an event, the Ten VM will do the following: 1. call the `eventVisibility` with the event being requested and the requester. 2. If the function exists and returns 'true', then return the event. If it returns `false`, then the event is invisible. @@ -109,12 +109,12 @@ public, privacy-leaking `Transfer` event. This rule adds another dimension to the reasoning process, because there is an implicit user to whom the event is relevant. It also reduces flexibility in sending lifecycle events to administrators. -## Obscuro events implementation +## Ten events implementation Our goal is to implement the visibility rules described above without modifying the Ethereum events API. We will look first at the changes to the enclave, then those to the host, and finally those to the RPC client. -### Obscuro enclave +### Ten enclave #### Creating and deleting logs subscriptions @@ -160,7 +160,7 @@ the log filter and the address the logs are for. It then crawls the chain, extra and are relevant based on the address provided. It returns these logs encrypted with the viewing key corresponding to the address provided. -### Obscuro host +### Ten host #### Logs subscriptions @@ -185,7 +185,7 @@ on to the corresponding Geth `rpc.Subscription`. For log snapshot requests, it is again forwarded blindly to the enclave, with the host unable to learn anything about the request or response. -### Obscuro encrypted RPC client +### Ten encrypted RPC client Due to their sensitive nature, logs requests and log subscriptions must pass through the encrypted RPC client. @@ -193,7 +193,7 @@ Due to their sensitive nature, logs requests and log subscriptions must pass thr The encrypted RPC client only handles logs subscriptions via the `eth_subscribe` and `eth_unsubscribe` APIs (see [here](https://ethereum.org/en/developers/tutorials/using-websockets/#eth-subscribe)). A consequence of this is that -events are only available in Obscuro over a websocket connection. +events are only available in Ten over a websocket connection. In response to the incoming `eth_subscribe` request, the client creates a `logs` subscription to the host by making a `rpc.Client.Subscribe` call via the embedded Geth client. It passes as a parameter a `LogSubscription` object encrypted diff --git a/design/ux/Obscuro_Gateway.md b/design/ux/Obscuro_Gateway.md index 78df291b84..6c58a31d28 100644 --- a/design/ux/Obscuro_Gateway.md +++ b/design/ux/Obscuro_Gateway.md @@ -1,6 +1,6 @@ -# The Obscuro Gateway - Design +# The Ten Gateway - Design -The scope of this document is to design a hosted [Wallet Extension](wallet_extension.md) called the "Obscuro Gateway" (OG). +The scope of this document is to design a hosted [Wallet Extension](wallet_extension.md) called the "Ten Gateway" (OG). The OG will be a superset of the WE functionality, so this document will only cover the additions. @@ -12,12 +12,12 @@ The current WE is designed to be used by a single user holding multiple addresse The OG must support mutiple users, each with multiple addresses. It can be seen as offering a WE per user. -The Obscuro node has no concept of "User". It only authenticates based on the "blockchain address". +The Ten node has no concept of "User". It only authenticates based on the "blockchain address". It expects to be supplied with a signed viewing key per address, so that it can respond encrypted with that VK. *Note that multiple addresses can share a VK.* -The role of the current WE is to manage a list of authenticated viewing keys (AVK), which it uses behind the scenes to communicate with an Obscuro node. +The role of the current WE is to manage a list of authenticated viewing keys (AVK), which it uses behind the scenes to communicate with an Ten node. The AVKs are stored on the local computer in a file. An AVK is a text containing the hash of the public viewing key signed with the "spending key" that controls a blockchain address. @@ -28,7 +28,7 @@ The diagram below depicts the setup once the OG is implemented. @startuml 'https://plantuml.com/deployment-diagram -cloud "Obscuro Nodes" +cloud "Ten Nodes" actor Alice component "Alice's Computer"{ @@ -39,29 +39,29 @@ component "Alice's Computer"{ Alice --> "Alice's MetaMask" "Alice's MetaMask" --> "Alice's Wallet Extension" "Alice's Wallet Extension" <-> "Alice's Viewing Keys" -"Alice's Wallet Extension" ----> "Obscuro Nodes" : Encrypted RPC +"Alice's Wallet Extension" ----> "Ten Nodes" : Encrypted RPC actor Bob component "Bob's Computer"{ agent "Bob's MetaMask" } component "Confidential Web Service"{ - node "Obscuro Gateway" + node "Ten Gateway" database "OG Viewing Keys" } -"OG Viewing Keys" <-> "Obscuro Gateway" +"OG Viewing Keys" <-> "Ten Gateway" Bob --> "Bob's MetaMask" -"Bob's MetaMask" ---> "Obscuro Gateway" : HTTPS -"Obscuro Gateway" ----> "Obscuro Nodes" : Encrypted RPC +"Bob's MetaMask" ---> "Ten Gateway" : HTTPS +"Ten Gateway" ----> "Ten Nodes" : Encrypted RPC actor Charlie component "Charlie's Computer"{ agent "Charlie's MetaMask" } -node "Obscuro Gateway" +node "Ten Gateway" Charlie --> "Charlie's MetaMask" -"Charlie's MetaMask" ---> "Obscuro Gateway" : HTTPS +"Charlie's MetaMask" ---> "Ten Gateway" : HTTPS @enduml ``` @@ -86,11 +86,11 @@ autonumber actor "Alice's Browser" as Alice participant MetaMask as MM -participant "https://gateway.obscuro.network/v1" as OG -participant "https://obscuro.network" as ON +participant "https://gateway.ten.org/v1" as OG +participant "https://ten.org" as ON group First click - Alice -> ON: Join Obscuro + Alice -> ON: Join Ten ON --> Alice: Redirect to OG note right The point of this sequence @@ -104,11 +104,11 @@ group First click the Public Key of the VK end note OG -> Alice: Send UserId - Alice -> MM: Automatically add "Obscuro" network with RPC\n"https://gateway.obscuro.network/v1?u=$UserId" + Alice -> MM: Automatically add "Ten" network with RPC\n"https://gateway.ten.org/v1?u=$UserId" end group Second click - Alice -> MM : Connect wallet and switch to Obscuro + Alice -> MM : Connect wallet and switch to Ten end group Third click @@ -121,42 +121,42 @@ group Third click Alice -> MM : Confirm signature end -Alice -> OG: All further Obscuro interactions will be to\nhttps://gateway.obscuro.network/v1?u=$UserId +Alice -> OG: All further Ten interactions will be to\nhttps://gateway.ten.org/v1?u=$UserId @enduml ``` The onboarding should be done in 3 clicks. -1. The user goes to a website (like "obscuro.network"), where she clicks "Join Obscuro". This will add a network to their wallet. +1. The user goes to a website (like "ten.org"), where she clicks "Join Ten". This will add a network to their wallet. 2. User connects the wallet to the page. 3. In the wallet popup, the user has to sign over a message: "Register $UserId for $ACCT" ##### Click 1 -1. Behind the scenes, a js functions calls "gateway.obscuro.network/v1/join" where it will generate a VK and send back the hash of the Public key. This is the "UserId" +1. Behind the scenes, a js functions calls "gateway.ten.org/v1/join" where it will generate a VK and send back the hash of the Public key. This is the "UserId" 2. After receiving the UserId, the js function will add a new network to the wallet. -The RPC URL of the new Obscuro network will include the userid: "https://gateway.obscuro.network/v1?u=$UserId". +The RPC URL of the new Ten network will include the userid: "https://gateway.ten.org/v1?u=$UserId". Notice that the UserId has to be included as a query parameter because it must be encrypted by https, as it is secret. ##### Click 2 -After these actions are complete, the same page will now ask the user to connect the wallet and switch to Obscuro. +After these actions are complete, the same page will now ask the user to connect the wallet and switch to Ten. Automatically the page will open metamask and ask the user to sign over a text "Register $UserId for $ACCT", where ACCT is the current account selected in metamask. ##### Click 3 -Once signed, this will be submitted in the background to: "https://gateway.obscuro.network/v1?u=$UserId&action=register" +Once signed, this will be submitted in the background to: "https://gateway.ten.org/v1?u=$UserId&action=register" Note: Any further accounts will be registered similarly for the same UserId. Note: The user must guard the UserId. Anyone who can read it, will be able to read the data of this user. -The ultimate goal of this protocol is to submit the "Register $UserId for $ACCT" text to the gateway, which is required by an Obscuro node to authenticate viewing keys per address. +The ultimate goal of this protocol is to submit the "Register $UserId for $ACCT" text to the gateway, which is required by an Ten node to authenticate viewing keys per address. Note: Alternative UXes that achieve the same goal are ok. ### Register subsequent addresses -User Alice is onboarded already and has the Obscuro network configured in her wallet with a UserId. +User Alice is onboarded already and has the Ten network configured in her wallet with a UserId. She has to go to the same landing page as above and connect her wallet, instead of hitting "Join". When connecting, she can choose a second account. diff --git a/design/ux/block_explorer.md b/design/ux/block_explorer.md index 7e345ba8f5..5a779bc183 100644 --- a/design/ux/block_explorer.md +++ b/design/ux/block_explorer.md @@ -2,7 +2,7 @@ ## Scope -The design for the Obscuro block explorers, tools to allow users to make sense of the contents of the Obscuro chain. +The design for the Ten block explorers, tools to allow users to make sense of the contents of the Ten chain. There will be two tools - a public block explorer that only displays public information, and a private block explorer that also displays private information belonging to that user. @@ -56,7 +56,7 @@ useful view to the customer. For example, a user may wish to view all the transf contract, which requires walking the chain and storing the results locally so that they don't have to be continuously recomputed. -However, a decisive upside of building our own block explorers is that Obscuro's rules about data visibility mean that +However, a decisive upside of building our own block explorers is that Ten's rules about data visibility mean that an off-the-shelf block explorer is unlikely to be fit for purpose in various ways, and will require extensive customisation. We talk about that in section `Fork an existing block explorer for the public block explorer`, below. @@ -75,12 +75,12 @@ BlockScout is an open-source block explorer, used by Secret Network among others In theory, this would give us a block explorer "for free". In practice, we'd need to customise BlockScout to a large extent, even for the public block explorer, for two reasons: -* It cannot handle the fact that some information about the Obscuro chain is returned in an encrypted form. For - example, if vanilla BlockScout is connected to an Obscuro host, it correctly displays the number of Obscuro blocks, +* It cannot handle the fact that some information about the Ten chain is returned in an encrypted form. For + example, if vanilla BlockScout is connected to an Ten host, it correctly displays the number of Ten blocks, but it considers every block to have zero transactions, because it chokes on the encrypted transaction contents being returned * Every advanced block explorer has some customised handling of standard contracts. For example, for ERC-20, it will - process the chain to allow a given address to see its entire holdings of various tokens. In Obscuro, this processing + process the chain to allow a given address to see its entire holdings of various tokens. In Ten, this processing would have to happen inside the enclave, since the block explorer would not have access to the transaction contents. Since BlockScout is not written with this in mind, it would entail a large amount of custom code. This is especially true since the logical place to do this sensitive processing is inside the enclave, but BlockScout is not written in @@ -92,4 +92,4 @@ of viewing keys. Forking BlockScout would require us to develop skills we don't have currently (e.g. it is written in Elixir). Once BlockScout was forked, we'd have to maintain the fork. Blockscout is currently c. 270k lines of code, 20% larger -than the Obscuro codebase as of this writing. +than the Ten codebase as of this writing. diff --git a/design/ux/user_data_incentives.md b/design/ux/user_data_incentives.md index beeb00ffc9..7ca73efd36 100644 --- a/design/ux/user_data_incentives.md +++ b/design/ux/user_data_incentives.md @@ -1,4 +1,4 @@ -# User interaction with Obscuro +# User interaction with Ten In a typical transparent blockchain, there are service providers like "Infura" who act as the interface to the blockchain from the point of view of most users. @@ -29,7 +29,7 @@ Also, the service provider will not gain any insights from this service since al The usual rescue in the crypto space is to employ incentives. -Obscuro is a decentralised network of nodes with different roles who already have their own incentives (Aggregators and Verifiers). +Ten is a decentralised network of nodes with different roles who already have their own incentives (Aggregators and Verifiers). The ideal scenario is to have a large and diverse community of verifiers node to make sure that the network functions correctly. @@ -62,7 +62,7 @@ Given that everyone is now expecting this to be a free service, this is unlikely The network (or protocol) charges fees from user when submitting transactions. This is something that users expect to pay. -The Obscuro protocol is designed in such a way that it decouples the income from the costs by maintaing a buffer. +The Ten protocol is designed in such a way that it decouples the income from the costs by maintaing a buffer. We can use this designed mechanism to pay for node usage as well along with the L1 gas fees and the general incentives to follow the protocol. diff --git a/design/ux/wallet_extension.md b/design/ux/wallet_extension.md index 4d4727c0e0..7116f7074a 100644 --- a/design/ux/wallet_extension.md +++ b/design/ux/wallet_extension.md @@ -3,7 +3,7 @@ ## Scope The design for the wallet extension, a component that is responsible for handling RPC requests from traditional -Ethereum wallets (e.g. MetaMask, hardware wallets), tooling (e.g. Remix) and webapps to the Obscuro host. +Ethereum wallets (e.g. MetaMask, hardware wallets), tooling (e.g. Remix) and webapps to the Ten host. ## Requirements @@ -44,7 +44,7 @@ Ethereum wallets (e.g. MetaMask, hardware wallets), tooling (e.g. Remix) and web ## Design -The wallet extension is a local server application that maintains an RPC connection to one or more Obscuro hosts. It +The wallet extension is a local server application that maintains an RPC connection to one or more Ten hosts. It serves two endpoints: * An endpoint for managing viewing keys @@ -68,9 +68,9 @@ event, the following steps are taken: * The wallet extension stores the private key locally, tagged with the address it is associated with * The end user signs a payload containing the public key and some metadata using an account key in their wallet (e.g. MetaMask), proving that the viewing key is "authorised" by the account in question -* The wallet extension sends the public key and signature to the Obscuro enclave via the Obscuro host over RPC -* The Obscuro enclave checks the signature -* The Obscuro enclave stores the public key locally, tagged with the address it is associated with +* The wallet extension sends the public key and signature to the Ten enclave via the Ten host over RPC +* The Ten enclave checks the signature +* The Ten enclave stores the public key locally, tagged with the address it is associated with Whenever an enclave needs to send sensitive information to the end user (e.g. a transaction result or account balance), it encrypts the sensitive information with the viewing key associated with the account. This ensures that the sensitive @@ -88,14 +88,14 @@ viewing keys for the configured host (as identified by the URL and port) are loa The wallet extension serves a standard implementation of the Ethereum JSON-RPC specification, except in the following respects: -* The wallet extension encrypts any request containing sensitive information with the Obscuro enclave public key before - forwarding it to the Obscuro host +* The wallet extension encrypts any request containing sensitive information with the Ten enclave public key before + forwarding it to the Ten host * The enclave encrypts any response containing sensitive information with the viewing public key for the address *associated* with that request (see below) * The wallet extension decrypts any encrypted responses with the viewing private key before forwarding them on to the user -This ensures that the encryption and decryption involved in the Obscuro protocol is transparent to the end user, and +This ensures that the encryption and decryption involved in the Ten protocol is transparent to the end user, and that we are not relying on decryption capabilities being available in the wallet. How do we determine which address is associated with a given request? @@ -108,7 +108,7 @@ How do we determine which address is associated with a given request? ### Handling `eth_call` requests Certain tools (e.g. MetaMask) do not set the `from` field in `eth_call` requests, since this field is marked as -optional in the Ethereum standard. However, this is problematic for Obscuro, since we need to use this field to +optional in the Ethereum standard. However, this is problematic for Ten, since we need to use this field to determine which viewing public key to use to encrypt the response. We therefore attempt to set any missing `from` fields in `eth_call` requests programmatically, as follows: @@ -157,7 +157,7 @@ Snaps are an experimental MetaMask capability. Snaps have several downsides: -* Snaps need to be installed per-page, requiring a code change in every webapp to prompt the user to install the Obscuro +* Snaps need to be installed per-page, requiring a code change in every webapp to prompt the user to install the Ten snap * Snaps are only compatible with MetaMask * Snaps are marked as experimental and require users to switch from MetaMask to the experimental MetaMask Flask diff --git a/developer_onboarding_guide.md b/developer_onboarding_guide.md index af4c645d4b..731ab660bd 100644 --- a/developer_onboarding_guide.md +++ b/developer_onboarding_guide.md @@ -46,10 +46,10 @@ If you're making substantial changes that could affect E2E tests, you can manual To do so, follow these steps: -- Go to the [obscuro-test](https://github.com/obscuronet/obscuro-test/actions) repository -- Click on the `Run local tests` [link](https://github.com/obscuronet/obscuro-test/actions/workflows/run_local_tests.yml) +- Go to the [ten-test](https://github.com/ten-protocol/ten-test/actions) repository +- Click on the `Run local tests` [link](https://github.com/ten-protocol/ten-test/actions/workflows/run_local_tests.yml) - Click `Run workflow`, enter the name of your branch, and then click `Run workflow` -## Obscuro smart contracts +## Ten smart contracts -Documentation for Obscuro smart contracts is available [here](https://github.com/obscuronet/go-obscuro/blob/main/contracts/README.md). \ No newline at end of file +Documentation for Ten smart contracts is available [here](https://github.com/ten-protocol/go-ten/blob/main/contracts/README.md). \ No newline at end of file diff --git a/dockerfiles/README.md b/dockerfiles/README.md index f2da0416e0..15714d604b 100644 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -1,6 +1,6 @@ -# Obscuro enclave service Docker image +# Ten enclave service Docker image -The Docker image defined by `enclave.Dockerfile` creates a Docker image for an Obscuro enclave service running in SGX. +The Docker image defined by `enclave.Dockerfile` creates a Docker image for an Ten enclave service running in SGX. To build the image, run: docker build -t enclave -f dockerfiles/enclave.Dockerfile . @@ -12,18 +12,18 @@ local machine, and `YYY` is the address of the node that this enclave service is docker run -p XXX:11000/tcp enclave --hostID YYY --address :11000 -By default, the image runs the Obscuro enclave service in SGX simulation mode. To run the enclave service in +By default, the image runs the Ten enclave service in SGX simulation mode. To run the enclave service in non-simulation mode instead, run: docker run -e OE_SIMULATION=0 --privileged -v /dev/sgx:/dev/sgx -p XXX:11000/tcp enclave --hostID YYY --address :11000 --willAttest=true -Stop and remove all Obscuro docker containers: +Stop and remove all Ten docker containers: docker rm $(docker stop $(docker ps -a -q --filter ancestor=enclave --format="{{.ID}}")) ## Data directory -The ego docker images setup a home directory in `/home/obscuro/` and within that `go-obscuro/` contains the code +The ego docker images setup a home directory in `/home/ten/` and within that `go-ten/` contains the code while `data/` is used for persistence by the enclave. -That `/home/obscuro/data` directory is mounted inside the enclave as `/data`, any files written to it by the enclave process +That `/home/ten/data` directory is mounted inside the enclave as `/data`, any files written to it by the enclave process should be sealed using the private enclave key, so it will be unreadable to anyone that accesses the container. \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 107f3b6b58..28fd17c6e3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,17 +1,17 @@ -# Obscuro Doc Site +# Ten Doc Site -This is the Obscuro Doc Site and it looks like [this](https://docs.obscu.ro/). +This is the Ten Doc Site and it looks like [this](https://docs.obscu.ro/). ## Adding New Doc Site Pages -1. Clone this repository: https://github.com/obscuronet/go-obscuro +1. Clone this repository: https://github.com/ten-protocol/go-ten 2. Create your new content as a Markdown file in the `/docs` folder of the repo. Take care with the folder structure. As a general rule, new titles in the left hand navigation menu should have their content contained in a seperate subfolder under docs, for example, `/docs/testnet` contains all the Markdown files relation to the testnet docs. 3. To have this new content shown in the left-hand navigation menu you need to modify the file `/docs/_data/navigation.yml`. Follow the same format to add new headings and content titles. Remember to specify the file type as `.html` for your new Markdown files, not `.md` when providing the URL. -4. Push your changes to obscuronet/go-obscuro +4. Push your changes to tennet/go-ten 5. GitHub Pages will trigger a GitHub Action to use a Jekyll build job to create the static content and then publish the pages at the custom URL. 6. Browse to https://docs.obscu.ro/ and check your content. Remember your browser will cache some of the pages so hit diff --git a/docs/_docs/api/apis.md b/docs/_docs/api/apis.md index bdddb7868f..228b44321b 100644 --- a/docs/_docs/api/apis.md +++ b/docs/_docs/api/apis.md @@ -1,13 +1,13 @@ --- --- -# Obscuro JSON-RPC API +# Ten JSON-RPC API -Obscuro supports a subset of Ethereum's [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/). This +Ten supports a subset of Ethereum's [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/). This page details which JSON-RPC API methods are supported. ## Supported JSON-RPC API methods -Obscuro nodes support the following JSON-RPC API methods over both HTTP and websockets: +Ten nodes support the following JSON-RPC API methods over both HTTP and websockets: * `eth_blockNumber` * `eth_call` diff --git a/docs/_docs/api/debug-apis.md b/docs/_docs/api/debug-apis.md index 1916c3855e..a925de3b19 100644 --- a/docs/_docs/api/debug-apis.md +++ b/docs/_docs/api/debug-apis.md @@ -2,12 +2,12 @@ --- # Debug JSON-RPC API -Obscuro supports a subset of Geth's [DEBUG JSON-RPC API](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug). This +Ten supports a subset of Geth's [DEBUG JSON-RPC API](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug). This page details which Debug JSON-RPC API methods are supported. ## Supported JSON-RPC API methods -Obscuro nodes support the following JSON-RPC API methods over both HTTP and websockets: +Ten nodes support the following JSON-RPC API methods over both HTTP and websockets: * `debug_traceTransaction` * `debug_eventLogRelevancy`: returns all event logs generated by the transaction Id, together with the relevancy metadata. Intended for developers on dev networks to debug smart contracts. This call is disabled for production networks diff --git a/docs/_docs/api/sensitive-apis.md b/docs/_docs/api/sensitive-apis.md index 0432ae6874..b8188a990e 100644 --- a/docs/_docs/api/sensitive-apis.md +++ b/docs/_docs/api/sensitive-apis.md @@ -2,7 +2,7 @@ --- # Sensitive APIs -Obscuro supports a subset of Ethereum's [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/). +Ten supports a subset of Ethereum's [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/). Some of these methods deal with sensitive information. For example, the response to an `eth_getBalance` request will contain the balance of an account. An attacker could intercept this response to discover a user's balance. To avoid diff --git a/docs/_docs/community/contributions.md b/docs/_docs/community/contributions.md index 32325330fb..38a49831f0 100644 --- a/docs/_docs/community/contributions.md +++ b/docs/_docs/community/contributions.md @@ -1,14 +1,14 @@ --- --- -# Contributing to Obscuro +# Contributing to Ten -Obscuro will evolve to be *the* solution for privacy on Ethereum through the strength and dedication of the Obscuro community. Together we'll make Obscuro the most community-driven project in crypto. +Ten will evolve to be *the* solution for privacy on Ethereum through the strength and dedication of the Ten community. Together we'll make Ten the most community-driven project in crypto. -As detailed in the [whitepaper](https://whitepaper.obscu.ro), Obscuro is powered by OBX, a native utility token that provides security to the Obscuro network while allowing holders to pay transaction fees. +As detailed in the [whitepaper](https://whitepaper.obscu.ro), Ten is powered by TEN, a native utility token that provides security to the Ten network while allowing holders to pay transaction fees. 2% of tokens are set aside for early contributors. Each contributor's allocation is a percentage of their total contributions against the entire community contribution. -For example, suppose you contribute work worth 10 'task points' and the community as a whole contributes 200 'task points'. In that case, you'll be allocated 5% of the contributor tokens or 0.1% of all available OBX tokens. These tokens will be held and distributed to you according to the vesting schedule detailed in the [tokenomics](https://github.com/obscuronet/foundation/blob/main/token-utility-whitepaper.md). Upon vesting, they will be sent to your wallet. +For example, suppose you contribute work worth 10 'task points' and the community as a whole contributes 200 'task points'. In that case, you'll be allocated 5% of the contributor tokens or 0.1% of all available TEN tokens. These tokens will be held and distributed to you according to the vesting schedule detailed in the [tokenomics](https://github.com/ten-protocol/foundation/blob/main/token-utility-whitepaper.md). Upon vesting, they will be sent to your wallet. To help manage contributions, we use DeWork. It's a lot like Trello but crypto-native. The DeWork board has a load of suggested tasks. Anyone can add additional tasks and manage the lifecycle through to completion. Anyone in the community can suggest a task that will benefit the project and community by adding it to the community suggestions group. diff --git a/docs/_docs/cross-chain/bridge.md b/docs/_docs/cross-chain/bridge.md index f4a8f17e43..36e62d31d3 100644 --- a/docs/_docs/cross-chain/bridge.md +++ b/docs/_docs/cross-chain/bridge.md @@ -1,8 +1,8 @@ --- --- -# The Standard Obscuro Bridge +# The Standard Ten Bridge -The standard Obscuro bridge is a trustless and decentralised asset bridge that uses a wrapped token mint and burn pattern. Under the hood it is based on the cross chain messaging protocol and exists entirely as a smart contract without the need of separate runnables or nodes. +The standard Ten bridge is a trustless and decentralised asset bridge that uses a wrapped token mint and burn pattern. Under the hood it is based on the cross chain messaging protocol and exists entirely as a smart contract without the need of separate runnables or nodes. ## Contract Addresses @@ -21,24 +21,24 @@ The value received by the bridge contract during the execution of `sendNative` i ## Layer 1 To Layer 2 Specifics -The `ObscuroBridge.sol` contract is responsible for managing the layer 1 side of the bridge. It's the "bridge to Obscuro". +The `TenBridge.sol` contract is responsible for managing the layer 1 side of the bridge. It's the "bridge to Ten". The `EthereumBridge.sol` contract is responsible for managing the layer 2 side of the bridge. It's the "bridge to Ethereum". In order to bridge tokens over they need to be whitelisted. **Initially only accounts with the admin role can whitelist tokens!** When the protocol has matured this whitelisting functionality will change. If you want your token to be whitelisted, get in touch with us through our discord. -When an asset is whitelisted, the bridge internally uses the `publishMessage` call on the `MessageBus` contract which is deployed and exposed by the `ManagementContract` on layer 1. In the message that is published the bridge "tells" the other side of it, which resides on layer 2 that a token has been whitelisted. This in turn creates a wrapped version of the token on the other side. This version of the token can only be minted and burned by the layer 2 bridge. Notice that when the bridge "tells" its counter part, the message is not automatically delivered by Obscuro. To automate the process one needs to have a relayer in place that will do it automatically and a system in place that funds the gas costs of said relayer. As the network grows general purpose relayers might pop up. If you are developing or have developed such a relayer, contact us on discord to get it listed. +When an asset is whitelisted, the bridge internally uses the `publishMessage` call on the `MessageBus` contract which is deployed and exposed by the `ManagementContract` on layer 1. In the message that is published the bridge "tells" the other side of it, which resides on layer 2 that a token has been whitelisted. This in turn creates a wrapped version of the token on the other side. This version of the token can only be minted and burned by the layer 2 bridge. Notice that when the bridge "tells" its counter part, the message is not automatically delivered by Ten. To automate the process one needs to have a relayer in place that will do it automatically and a system in place that funds the gas costs of said relayer. As the network grows general purpose relayers might pop up. If you are developing or have developed such a relayer, contact us on discord to get it listed. * Minting allows to create fresh funds on the L2 when they get locked on L1. * Burning allows to destroy supply on L2 in order to release it from the bridge on L1. -The protocol to bridge assets using `mint`/`burn` is based on the `MessageBus`'s `publishMessage` too. The `ObscuroBridge` tells the layer 2 that it has locked a certain amount of tokens and because of that address Y should receive the same amount of the wrapped token counterpart. This is when `mint` comes into play. On the other hand, the `EthereumBridge` burns tokens when received and tells the L1 that it has in fact done so. This is interpreted by the L1 smart contract as evidence to release locked funds. This message once again needs to be relayed for the process to work, but by a separate L1 relayer. +The protocol to bridge assets using `mint`/`burn` is based on the `MessageBus`'s `publishMessage` too. The `TenBridge` tells the layer 2 that it has locked a certain amount of tokens and because of that address Y should receive the same amount of the wrapped token counterpart. This is when `mint` comes into play. On the other hand, the `EthereumBridge` burns tokens when received and tells the L1 that it has in fact done so. This is interpreted by the L1 smart contract as evidence to release locked funds. This message once again needs to be relayed for the process to work, but by a separate L1 relayer. ## Security -The bridge inherits the `CrossChainEnabledObscuro` contract. It provides a modifier `onlyCrossChainSender` that can be attached to public smart contract functions in order to limit them. Normally you can limit a function to be called by `msg.sender`. With this new modifier you can limit a function to be called from the equivalent of `msg.crosschainsender`. In the `ObscuroBridge` we limit the cross chain sender to the remote bridge only like this `onlyCrossChainSender(remoteBridgeAddress)`. +The bridge inherits the `CrossChainEnabledTen` contract. It provides a modifier `onlyCrossChainSender` that can be attached to public smart contract functions in order to limit them. Normally you can limit a function to be called by `msg.sender`. With this new modifier you can limit a function to be called from the equivalent of `msg.crosschainsender`. In the `TenBridge` we limit the cross chain sender to the remote bridge only like this `onlyCrossChainSender(remoteBridgeAddress)`. -The bridge initialization phase links the two bridge contracts (ObscuroBridge, EthereumBridge) together. This linking is finalized when both contracts know the remote address on the opposite layer. Using those remote addresses, the bridges limit incoming `receiveAsset` messages to only be callable by the `CrossChainMessenger` contract sitting on the same layer. This `CrossChainMessenger` contract provides the necessary context to the bridge about the sender of the cross chain message. This allows to validate message is coming from the `remoteBridgeAddress`. The sender address is determined inside of `publishMessage` by taking the `msg.sender`. This `msg.sender` is put inside the metadata of each message. +The bridge initialization phase links the two bridge contracts (TenBridge, EthereumBridge) together. This linking is finalized when both contracts know the remote address on the opposite layer. Using those remote addresses, the bridges limit incoming `receiveAsset` messages to only be callable by the `CrossChainMessenger` contract sitting on the same layer. This `CrossChainMessenger` contract provides the necessary context to the bridge about the sender of the cross chain message. This allows to validate message is coming from the `remoteBridgeAddress`. The sender address is determined inside of `publishMessage` by taking the `msg.sender`. This `msg.sender` is put inside the metadata of each message. The result of this setup is that `receiveAsset` is only callable by having a valid cross chain message coming from the correct contract. Anything else will get rejected and cause the call to revert. diff --git a/docs/_docs/cross-chain/core-messaging-layer.md b/docs/_docs/cross-chain/core-messaging-layer.md index 39c20bbf0f..4e8acd21b7 100644 --- a/docs/_docs/cross-chain/core-messaging-layer.md +++ b/docs/_docs/cross-chain/core-messaging-layer.md @@ -1,8 +1,8 @@ --- --- -# Obscuro Cross Chain Messaging +# Ten Cross Chain Messaging -Obscuro is equipped with a cross chain messaging protocol that enables sending and receiving messages across layers securely and in an entirely decentralized fashion. +Ten is equipped with a cross chain messaging protocol that enables sending and receiving messages across layers securely and in an entirely decentralized fashion. The core contract that provides this functionality is the `MessageBus`. It exists both on L1 and L2. In the L1 you can find it under the management contract whilst on the L2 it is created and managed by the protocol. @@ -14,7 +14,7 @@ When the message is made available, users can call the `verifyMessageFinalized` This allows to have a behaviour much like querying questions - **'Has the address 0xAAAA.. received 25WETH tokens on the bridge with address 0XAB0FF?'**. If the bridge on this address has called `publishMessage` saying **'I have received 25 WETH tokens with recipient 0xAAAA.`** the query will return true. -When messages are published on the Obscuro layer (L2) the transport to L1 is done by the management contract upon rollup submission. Messages delivered however need to wait for the challenge period of the rollup before being considered final. This ensures that rollups along with the messages they carry can be challenged. This is the logical equivalent of challenge period for optimistic rollups. +When messages are published on the Ten layer (L2) the transport to L1 is done by the management contract upon rollup submission. Messages delivered however need to wait for the challenge period of the rollup before being considered final. This ensures that rollups along with the messages they carry can be challenged. This is the logical equivalent of challenge period for optimistic rollups. ## Advanced capabilities diff --git a/docs/_docs/testnet/Introduction.md b/docs/_docs/testnet/Introduction.md index 46dfb5209c..efc0bba8e0 100644 --- a/docs/_docs/testnet/Introduction.md +++ b/docs/_docs/testnet/Introduction.md @@ -1,15 +1,15 @@ --- --- -# Introducing Obscuro's first testnet, Evan's Cat +# Introducing Ten's first testnet, Evan's Cat This section contains detailed on how to connect, build and deploy on Evan's Cat. Evan's Cat is designed with developers in mind. It provides the latest upgrades and tooling for developers to deploy and test their dApps. -Evan's Cat can also be used by end users to help test Obscuro and test developer dApps. Evan's Cat does not focus on node operators. Support for node operators will arrive in the next version of testnet. +Evan's Cat can also be used by end users to help test Ten and test developer dApps. Evan's Cat does not focus on node operators. Support for node operators will arrive in the next version of testnet. Developers can expect frequent updates which will be communicated [here](https://docs.obscu.ro/testnet/changelog). The trade-off is that in the early days Testnet will have some sharp edges and unexpected surprises. More specifically, whilst Testnet is in its infancy: -* Obscuro Testnet will crash from time to time, and will frequently be updated with new features. -* When Obscuro Testnet restarts expect to lose everything. -* Obscuro Testnet code has not been optimised or audited yet. (Mainnet code will be audited prior to launch.) +* Ten Testnet will crash from time to time, and will frequently be updated with new features. +* When Ten Testnet restarts expect to lose everything. +* Ten Testnet code has not been optimised or audited yet. (Mainnet code will be audited prior to launch.) * The [Wallet extension](https://docs.obscu.ro/wallet-extension/wallet-extension) is still being improved. * The decryption key is known by all allowing you to decrypt and view everything. This also allows the wider community to support you in development. -All Obscuro code is under an open source licence. If you see something you think could be improved or reworked feel free to submit a PR in the [go-obscuro repo](https://github.com/obscuronet/go-obscuro), or to let us know about your suggestion on [Discord](https://discord.com/channels/916052669955727371/945360340613484684). +All Ten code is under an open source licence. If you see something you think could be improved or reworked feel free to submit a PR in the [go-ten repo](https://github.com/ten-protocol/go-ten), or to let us know about your suggestion on [Discord](https://discord.com/channels/916052669955727371/945360340613484684). diff --git a/docs/_docs/testnet/changelog.md b/docs/_docs/testnet/changelog.md index 41936bd86a..ce964ce99b 100644 --- a/docs/_docs/testnet/changelog.md +++ b/docs/_docs/testnet/changelog.md @@ -1,6 +1,6 @@ --- --- -# Obscuro Testnet Change Log +# Ten Testnet Change Log # Oct 2023-10-26 (v0.19.0) * A list of the PRs merged in this release is as below; @@ -689,9 +689,9 @@ * A variety of stability related issues are fixed within this release. * Inclusion of a health endpoint for system status monitoring. * It is now possible to run an Obscuroscan against a locally deployed testnet. For more information see - [building and running a local testnet](https://github.com/obscuronet/go-obscuro/blob/main/README.md#building-and-running-a-local-testnet) + [building and running a local testnet](https://github.com/ten-protocol/go-ten/blob/main/README.md#building-and-running-a-local-testnet) in the project readme. -* Obscuroscan's GitHub Actions [deploy script](https://github.com/obscuronet/go-obscuro/blob/main/.github/workflows/manual-deploy-obscuroscan.yml) has been modified to run the public Testnet Obscuroscan as an Azure web app. This allows access via HTTPS (TLS), which allows app developers to call the Obscuroscan API from other web apps. +* Obscuroscan's GitHub Actions [deploy script](https://github.com/ten-protocol/go-ten/blob/main/.github/workflows/manual-deploy-obscuroscan.yml) has been modified to run the public Testnet Obscuroscan as an Azure web app. This allows access via HTTPS (TLS), which allows app developers to call the Obscuroscan API from other web apps. * A list of the relevant PRs addressed in this release is as below; * `12a04c40` Checks whether the head rollup is nil (#859) * `619d39b4` Clarify that blocks are L1 blocks (#858) @@ -746,9 +746,9 @@ a contract](https://docs.obscu.ro/testnet/deploying-a-smart-contract-programmatically/) has been updated accordingly. * The ability to start a faucet server against a local testnet deployment is now supported via a docker container. For more information see the Obscuro - [readme](https://github.com/obscuronet/go-obscuro#building-and-running-a-local-faucet). -* Updates to the [Events](https://github.com/obscuronet/go-obscuro/blob/main/design/ux/Events_design.md) design - inclusion of the [Fast Finality](https://github.com/obscuronet/go-obscuro/blob/main/design/finality_protocol/fast_finality.md) design. + [readme](https://github.com/ten-protocol/go-ten#building-and-running-a-local-faucet). +* Updates to the [Events](https://github.com/ten-protocol/go-ten/blob/main/design/ux/Events_design.md) design + inclusion of the [Fast Finality](https://github.com/ten-protocol/go-ten/blob/main/design/finality_protocol/fast_finality.md) design. * The [Obscuro docs site](https://docs.obscu.ro/) is now searchable. * Testnet is now officially termed `Evan's Cat`. @@ -761,7 +761,7 @@ * Event Subscriptions: * Event subscriptions for logs are now supported via the eth_subscribe and eth_getLogs approaches. This has been tested using both the ethers and web3js libraries. Note that eth_newFilter is not currently supported. For more - information see [the events design](https://github.com/obscuronet/go-obscuro/blob/main/design/Events_design.md). + information see [the events design](https://github.com/ten-protocol/go-ten/blob/main/design/Events_design.md). ## September 2022-09-22 (v0.4) * Wallet extension: @@ -801,7 +801,7 @@ * The node operator can configure the minimum gas price their aggregator will accept on startup. * Wallet extension * The wallet extension now supports multiple viewing keys through a single running instance. For more information see - the [wallet extension design doc](https://github.com/obscuronet/go-obscuro/blob/main/design/ux/wallet_extension.md), + the [wallet extension design doc](https://github.com/ten-protocol/go-ten/blob/main/design/ux/wallet_extension.md), specifically `Handling eth_call requests` for how the required viewing key is selected when multiple keys are registered. diff --git a/docs/_docs/testnet/deploying-a-smart-contract-programmatically.md b/docs/_docs/testnet/deploying-a-smart-contract-programmatically.md index ed426d58b5..36c9a00d69 100644 --- a/docs/_docs/testnet/deploying-a-smart-contract-programmatically.md +++ b/docs/_docs/testnet/deploying-a-smart-contract-programmatically.md @@ -1,11 +1,11 @@ --- --- -# Deploying a Smart Contract to Obscuro Testnet Programmatically -The steps below demonstrate how to programmatically create a new contract on to Obscuro Testnet and interact with it via +# Deploying a Smart Contract to Ten Testnet Programmatically +The steps below demonstrate how to programmatically create a new contract on to Ten Testnet and interact with it via call functions. The example uses [Python](https://www.python.org/) and [web3.py](https://web3py.readthedocs.io/en/stable/) as a reference but the principles of usage will be the same in any web3 language implementation. -A full working example can be seen in [deploying-a-smart-contract-programmatically.py](https://github.com/obscuronet/go-obscuro/blob/main/docs/_docs/testnet/deploying-a-smart-contract-programmatically.py). +A full working example can be seen in [deploying-a-smart-contract-programmatically.py](https://github.com/ten-protocol/go-ten/blob/main/docs/_docs/testnet/deploying-a-smart-contract-programmatically.py). Usage of the example requires Python > 3.9.13, solc 0.8.15 and the web3, requests, and json modules. It is assumed solc has been installed using homebrew and resides in `/opt/homebrew/bin/solc` and that the wallet extension is running on the local host with default values `WHOST=127.0.0.1` and `WPORT=3000`. @@ -25,7 +25,7 @@ account stored for later usage. ``` ## Request ETH from the faucet server for native ETH -An account needs gas to perform transactions on Obscuro, where gas is paid in native ETH. Requests of native ETH can be +An account needs gas to perform transactions on Ten, where gas is paid in native ETH. Requests of native ETH can be made through a POST to the faucet server where the address is supplied in the data payload. ```python headers = {'Content-Type': 'application/json'} @@ -68,7 +68,7 @@ release). An arbitrary `gasPrice` should be given e.g. the current price on the ``` ## Sign the transaction and send to the network -Using the account the transaction can be signed and submitted to the Obscuro Testnet. +Using the account the transaction can be signed and submitted to the Ten Testnet. ```python signed_tx = account.signTransaction(build_tx) tx_hash = None diff --git a/docs/_docs/testnet/deploying-a-smart-contract.md b/docs/_docs/testnet/deploying-a-smart-contract.md index b8e60171f7..a74c0c532d 100644 --- a/docs/_docs/testnet/deploying-a-smart-contract.md +++ b/docs/_docs/testnet/deploying-a-smart-contract.md @@ -1,27 +1,27 @@ --- --- -# Deploying a Smart Contract to Obscuro Testnet -Using the steps below you will add an extension to your MetaMask wallet so it can connect to Obscuro Testnet, then using Remix you will deploy your smart contract to Testnet. Remember there are no gas fees on Obscuro Testnet so you do not need to load your account with OBX tokens in advance. +# Deploying a Smart Contract to Ten Testnet +Using the steps below you will add an extension to your MetaMask wallet so it can connect to Ten Testnet, then using Remix you will deploy your smart contract to Testnet. Remember there are no gas fees on Ten Testnet so you do not need to load your account with TEN tokens in advance. ## Prerequisites * [MetaMask](https://metamask.io/) wallet installed in your browser. -* A local copy of the [Obscuro MetaMask wallet extension](https://docs.obscu.ro/wallet-extension/wallet-extension/) +* A local copy of the [Ten MetaMask wallet extension](https://docs.obscu.ro/wallet-extension/wallet-extension/) -## Prepare Your MetaMask Wallet for Obscuro Testnet -An essential part of how Obscuro provides full privacy is the encryption of communication between an Obscuro application and Obscuro nodes on the network. +## Prepare Your MetaMask Wallet for Ten Testnet +An essential part of how Ten provides full privacy is the encryption of communication between an Ten application and Ten nodes on the network. Follow the steps [here](https://docs.obscu.ro/wallet-extension/wallet-extension/) to configure and start the wallet extension and generate a viewing key. -If you do not have the Obscuro wallet extension running, MetaMask will not be able to communicate with the Obscuro +If you do not have the Ten wallet extension running, MetaMask will not be able to communicate with the Ten Testnet. > **_TIP_** Every time you restart the wallet extension, you must generate a new viewing key. This is because the private-key part of the viewing key is only held in memory and never persisted to disk, for security reasons. -Your wallet is now configured for the Obscuro Testnet which allows you to view encrypted traffic for your wallet only. -You can now go ahead and deploy your smart contract to the Obscuro Testnet. +Your wallet is now configured for the Ten Testnet which allows you to view encrypted traffic for your wallet only. +You can now go ahead and deploy your smart contract to the Ten Testnet. ## Deploy Your Smart Contract Using an IDE 1. Browse to the popular Solidity-compatible Integrated Development Environment called [Remix](https://remix.ethereum.org/). @@ -32,20 +32,20 @@ You can now go ahead and deploy your smart contract to the Obscuro Testnet. 1. Compile your smart contract using the Remix Solidity Compiler. -1. Log in to MetaMask and confirm you are connected to Obscuro Testnet network. The parameters for the Obscuro Testnet can be found [here](https://docs.obscu.ro/testnet/essentials/). +1. Log in to MetaMask and confirm you are connected to Ten Testnet network. The parameters for the Ten Testnet can be found [here](https://docs.obscu.ro/testnet/essentials/). -1. In the _Deploy & Run Transactions_ section of Remix change the Environment to _Injected Web3_. This tells Remix to use the network settings currently configured in your MetaMask wallet, which in this case is the Obscuro Testnet. If the connection to Obscuro Testnet is successful you will see the text _Custom (443) network_ displayed under _Injected Web3_. +1. In the _Deploy & Run Transactions_ section of Remix change the Environment to _Injected Web3_. This tells Remix to use the network settings currently configured in your MetaMask wallet, which in this case is the Ten Testnet. If the connection to Ten Testnet is successful you will see the text _Custom (443) network_ displayed under _Injected Web3_. -1. Click the _Deploy_ button to deploy your smart contract to the Obscuro Testnet. +1. Click the _Deploy_ button to deploy your smart contract to the Ten Testnet. 1. MetaMask will automatically open and ask you to confirm the transaction. Click _Confirm_. 1. Wait for your transaction to be confirmed. Notifications will be shown in MetaMask and Remix to indicate that the transaction was successful. -Congratulations, your smart contract is now deployed to Obscuro Testnet! +Congratulations, your smart contract is now deployed to Ten Testnet! -> **Be prepared to redeploy your smart contract to Obscuro Testnet often. The Testnet is likely to be restarted without warning!** As Testnet matures and new features are added it will become more and more stable, but in the early days do expect some turbulence. +> **Be prepared to redeploy your smart contract to Ten Testnet often. The Testnet is likely to be restarted without warning!** As Testnet matures and new features are added it will become more and more stable, but in the early days do expect some turbulence. -Because Obscuro provides full privacy, the details of your transaction are encrypted and only visible to you, as the holder of your wallet's private key. +Because Ten provides full privacy, the details of your transaction are encrypted and only visible to you, as the holder of your wallet's private key. -Now head over to the [ObscuroScan page](https://docs.obscu.ro/testnet/obscuroscan/) to see how you can view the transaction details. +Now head over to the [TenScan page](https://docs.obscu.ro/testnet/obscuroscan/) to see how you can view the transaction details. diff --git a/docs/_docs/testnet/essentials.md b/docs/_docs/testnet/essentials.md index cbfba40dfc..20b2f2d18e 100644 --- a/docs/_docs/testnet/essentials.md +++ b/docs/_docs/testnet/essentials.md @@ -6,19 +6,19 @@ Essential information, parameters and configuration settings for the Evan's Cat ## Limitations on Evan's Cat These are the key limitations to be aware of when developing for the Evan's Cat testnet: -1. New nodes cannot be added. For now the number of Obscuro nodes is fixed. +1. New nodes cannot be added. For now the number of Ten nodes is fixed. 1. Data revelation is not implemented yet. 1. Security is not fully implemented. Some keys are still hardcoded. 1. The decentralised bridge is limited to two hardcoded ERC20 tokens. -1. The Layer 1 is currently a hosted network. In the next iteration we'll connect Obscuro to an Ethereum testnet. -1. The "Wallet Extension" is not fully polished yet. You can expect a better UX as Obscuro develops +1. The Layer 1 is currently a hosted network. In the next iteration we'll connect Ten to an Ethereum testnet. +1. The "Wallet Extension" is not fully polished yet. You can expect a better UX as Ten develops -## Connection to an Obscuro Node +## Connection to an Ten Node - **RPC http address:** `erpc.sepolia-testnet.obscu.ro:80` - **RPC websocket address:** `erpc.sepolia-testnet.obscu.ro:81` ## Rollup Encryption/Decryption Key -The symmetric key used to encrypt and decrypt transaction blobs in rollups on the Obscuro Testnet: +The symmetric key used to encrypt and decrypt transaction blobs in rollups on the Ten Testnet: ``` bddbc0d46a0666ce57a466168d99c1830b0c65e052d77188f2cbfc3f6486588c @@ -26,7 +26,7 @@ bddbc0d46a0666ce57a466168d99c1830b0c65e052d77188f2cbfc3f6486588c N.B. Decrypting transaction blobs is only possible on testnet, where the rollup encryption key is long-lived and well-known. On mainnet, rollups will use rotating keys that are not known to anyone - or anything - other than the -Obscuro enclaves. +Ten enclaves. ## ERC20 Contracts We have a couple of testnet ERC20 tokens (HOC & POC) that are automatically deployed with a static address every time diff --git a/docs/_docs/testnet/example-dapps.md b/docs/_docs/testnet/example-dapps.md index 5fcadaaf34..ea375db34c 100644 --- a/docs/_docs/testnet/example-dapps.md +++ b/docs/_docs/testnet/example-dapps.md @@ -1,20 +1,20 @@ --- --- # Example dApps on Testnet -Obscuro Testnet includes an example dApp to help you better understand how dApps capitalise on Obscuro's unique encryption features. +Ten Testnet includes an example dApp to help you better understand how dApps capitalise on Ten's unique encryption features. ## Number Guessing Game -[A number guessing game](http://obscuronet.github.io/sample-applications/number-guessing-game) is a simple way of showcasing the principles of encryption in Obscuro. The goal of the game is to guess a secret number. Each time an attempt is made an entrance fee of 1 unit of the token is paid (with 1x10^18 units making a single token). If a player correctly guesses the number the contract will pay out all of the accumulated entrance fees to them and reset itself with a new random number. +[A number guessing game](http://tennet.github.io/sample-applications/number-guessing-game) is a simple way of showcasing the principles of encryption in Ten. The goal of the game is to guess a secret number. Each time an attempt is made an entrance fee of 1 unit of the token is paid (with 1x10^18 units making a single token). If a player correctly guesses the number the contract will pay out all of the accumulated entrance fees to them and reset itself with a new random number. Consider for a moment how a secret number could be created without divulging it. This is impossible in a transparent, decentralised ecosystem like Ethereum because when the secret number is generated by the smart contract it would be trivial to look up the internal state of the contract and see the secret number. OK, so let's imagine the internal state of the contract and therefore the secret number _is_ hidden, what happens when players start making their guesses? Using a block explorer to see the attempted guesses in plain view within the details of the transaction immediately provides new players with an unfair advantage and the game is ruined. -Building the guessing game in Obscuro addresses both scenarios described above. The guessing game smart contract generates a random secret number when it is deployed. This number is never revealed to a player or node operator, or indeed anybody because it is generated within a Trusted Execution Environment. And when players make their guesses the transactions carrying the guesses are encrypted and therefore obscured in a block explorer. +Building the guessing game in Ten addresses both scenarios described above. The guessing game smart contract generates a random secret number when it is deployed. This number is never revealed to a player or node operator, or indeed anybody because it is generated within a Trusted Execution Environment. And when players make their guesses the transactions carrying the guesses are encrypted and therefore obscured in a block explorer. ### How to Play 1. Start up the wallet extension. Follow instructions [here](https://docs.obscu.ro/wallet-extension/wallet-extension). -1. For the moment, the Guessing Game includes an ERC20 token (called OGG, short for Obscuro Guessing Game). This is partly because OGG is modified to have a built-in faucet: It allocates tokens to addresses as they make a request to allow other addresses to take tokens from their account. +1. For the moment, the Guessing Game includes an ERC20 token (called OGG, short for Ten Guessing Game). This is partly because OGG is modified to have a built-in faucet: It allocates tokens to addresses as they make a request to allow other addresses to take tokens from their account. 1. If you want to see this balance in your wallet, you have to import a new Token with the address: ``0x5FbDB2315678afecb367f032d93F642f64180aa3`` -1. Browse to [the number guessing game](http://obscuronet.github.io/sample-applications/number-guessing-game). Check you see `Network ID: 443` at the top of the game window to confirm you are connected to Obscuro Testnet. +1. Browse to [the number guessing game](http://tennet.github.io/sample-applications/number-guessing-game). Check you see `Network ID: 443` at the top of the game window to confirm you are connected to Ten Testnet. 1. MetaMask will open and ask to connect your account. Click `Next` then click `Connect`. 1. Approve the payment of 1 or more token units to play the game (this will be added to the prize pool) by clicking the `Approve game fee` button. 1. MetaMask will ask for your account to sign a transaction specifying the Guess contract address as the approval delegate. This means that you're giving permission for the game to take the participation fee. Click `Confirm`. Once approved you will see a confirmation popup. Click `OK`. @@ -23,8 +23,8 @@ Building the guessing game in Obscuro addresses both scenarios described above. 1. Open MetaMask to check the progress of your guess transaction in the `Activity` tab of MetaMask. Wait a few moments for it to change from pending to complete. 1. The game should show you two messages, one confirming the success of the Approval transaction, and the second confirming the result of the guess attempt (whether correct, wrong, warmer or colder than the last guess). -Once the guess transaction is completed you can check the guess transaction on ObscuroScan: -1. In MetaMask click on the transaction to open it then click `Copy Transaction ID`. Open [ObscuroScan](http://testnet.obscuroscan.io/). +Once the guess transaction is completed you can check the guess transaction on TenScan: +1. In MetaMask click on the transaction to open it then click `Copy Transaction ID`. Open [TenScan](http://testnet.tenscan.io/). 1. Paste your copied transaction ID into the search box to find your individual guess transaction. Note how the transaction data visible to everyone is encrypted in the field `EncryptedTxBlob` and how (for now) the transaction is decrypted to allow developers to confirm correct behaviour of the network. 1. You can see your guess as the number at the right hand end of the `input` value in a hexadecimal format, e.g. a guess of 99 is shown as 63. @@ -35,5 +35,5 @@ Once the guess transaction is completed you can check the guess transaction on O ### Next Steps -Now you have enjoyed playing the guessing game you are invited to make it even better! Go ahead and fork the guessing game code in this [GitHub repository](https://github.com/obscuronet/number-guessing-game) and bring your own contributions to Obscuro Testnet. +Now you have enjoyed playing the guessing game you are invited to make it even better! Go ahead and fork the guessing game code in this [GitHub repository](https://github.com/ten-protocol/number-guessing-game) and bring your own contributions to Ten Testnet. Of course, you are free to [deploy any smart contract](https://docs.obscu.ro/testnet/deploying-a-smart-contract) to the testnet. diff --git a/docs/_docs/testnet/faucet.md b/docs/_docs/testnet/faucet.md index 0ca27e478d..53777a402c 100644 --- a/docs/_docs/testnet/faucet.md +++ b/docs/_docs/testnet/faucet.md @@ -1,16 +1,16 @@ --- --- # Using the Testnet Token Faucet -Using the steps below you will request testnet ETH from the faucet available on the Obscuro Discord server. +Using the steps below you will request testnet ETH from the faucet available on the Ten Discord server. ## Prerequisites -* Access to the [Obscuro Discord server](https://discord.gg/yQfmKeNzNd). +* Access to the [Ten Discord server](https://discord.gg/yQfmKeNzNd). * (Optional) [MetaMask](https://metamask.io/) wallet installed in your browser. -* (Optional) A local copy of the [Obscuro MetaMask wallet extension](https://docs.obscu.ro/wallet-extension/wallet-extension/). +* (Optional) A local copy of the [Ten MetaMask wallet extension](https://docs.obscu.ro/wallet-extension/wallet-extension/). ## Requesting Testnet ETH 1. Make a note of your wallet address or copy it to your clipboard. -2. Open the [_faucet-requests_ channel](https://discord.gg/5qyj3qraaH) on Obscuro Discord. +2. Open the [_faucet-requests_ channel](https://discord.gg/5qyj3qraaH) on Ten Discord. 3. Request ETH using the `/faucet` command. The faucet will credit 0.5 ETH by default: ![faucet command](../../assets/images/faucet-cmd.png) 4. Provide your wallet address and hit Enter. The faucet will acknowledge your request: @@ -19,9 +19,9 @@ Using the steps below you will request testnet ETH from the faucet available on ![faucet complete](../../assets/images/faucet-done.png) ## Viewing Your Wallet Balance -To view the balance of your wallet you will need to establish a connection from your wallet to the Obscuro Testnet. An essential part of how Obscuro provides full privacy is the encryption of communication between an Obscuro application and Obscuro nodes on the network. As a result, you will need to use the wallet extension to allow your wallet to communication with the Obscuro Testnet. +To view the balance of your wallet you will need to establish a connection from your wallet to the Ten Testnet. An essential part of how Ten provides full privacy is the encryption of communication between an Ten application and Ten nodes on the network. As a result, you will need to use the wallet extension to allow your wallet to communication with the Ten Testnet. -Use the steps [here](https://docs.obscu.ro/testnet/deploying-a-smart-contract/#prepare-your-metamask-wallet-for-obscuro-testnet) to prepare your MetaMask wallet for Obscuro Testnet. +Use the steps [here](https://docs.obscu.ro/testnet/deploying-a-smart-contract/#prepare-your-metamask-wallet-for-ten-testnet) to prepare your MetaMask wallet for Ten Testnet. ## Requesting Testnet ETH directly In the event that you do not have access to Discord, or the faucet bot is not working, you can request ETH directly from diff --git a/docs/_docs/testnet/obscuroscan.md b/docs/_docs/testnet/obscuroscan.md index 2b66538ecd..d65ab5b026 100644 --- a/docs/_docs/testnet/obscuroscan.md +++ b/docs/_docs/testnet/obscuroscan.md @@ -1,13 +1,13 @@ --- --- -# ObscuroScan -ObscuroScan is a blockchain explorer for the Obscuro Testnet - -Obscuro's equivalent of Etherscan. ObscuroScan allows you to view the latest rollups and transactions on the Testnet, +# TenScan +TenScan is a blockchain explorer for the Ten Testnet - +Ten's equivalent of Etherscan. TenScan allows you to view the latest rollups and transactions on the Testnet, as well as search for historical rollups and transactions. Its functionality will be expanded over time. ## Usage -1. Go to the [ObscuroScan landing page](http://testnet.obscuroscan.io/) +1. Go to the [TenScan landing page](http://testnet.tenscan.io/) 2. Observe the feed of latest rollups and transactions. Click on any rollup number or transaction hash to see the details of the corresponding rollup and the L1 block where it was published 3. From the search bar in the top right, search for any rollup (using its number, e.g. `2453`) or transaction (using @@ -16,6 +16,6 @@ as well as search for historical rollups and transactions. Its functionality wil ## Decryption of Transaction Blobs Notice the _Decrypted transaction blob_ section for each rollup. This allows you to see the normally-encrypted -transactions in unencrypted plain text. This is a feature of Testnet aimed at helping you understand how Obscuro works, +transactions in unencrypted plain text. This is a feature of Testnet aimed at helping you understand how Ten works, and is only possible because Testnet uses a rollup encryption key that is long-lived and well-known. On Mainnet, -rollups will be encrypted with rotating keys that are not known to anyone, or anything, other than the Obscuro enclaves. +rollups will be encrypted with rotating keys that are not known to anyone, or anything, other than the Ten enclaves. diff --git a/docs/_docs/testnet/security.md b/docs/_docs/testnet/security.md index 530b22b6a6..fe2d6e4e27 100644 --- a/docs/_docs/testnet/security.md +++ b/docs/_docs/testnet/security.md @@ -2,9 +2,9 @@ --- # Testnet Security -The first Obscuro Testnet is focused on functionality and the User and Developer experience. +The first Ten Testnet is focused on functionality and the User and Developer experience. Privacy features require special attention from the core and security audit team and will be finalised in a future version of Testnet. -As a user of the "Obscuro Testnet", do not expect the data you are loading to be 100% private. +As a user of the "Ten Testnet", do not expect the data you are loading to be 100% private. diff --git a/docs/_docs/testnet/starting-a-node.md b/docs/_docs/testnet/starting-a-node.md index 3fd27251de..214088d870 100644 --- a/docs/_docs/testnet/starting-a-node.md +++ b/docs/_docs/testnet/starting-a-node.md @@ -19,25 +19,25 @@ sudo apt-get update \ && sudo snap refresh && sudo snap install --channel=1.20 go --classic ``` -#### - Download Obscuro repo +#### - Download Ten repo -Make sure to use the latest `` at https://github.com/obscuronet/go-obscuro/tags. +Make sure to use the latest `` at https://github.com/ten-protocol/go-ten/tags. ``` - git clone --depth 1 -b https://github.com/obscuronet/go-obscuro.git /home/obscuro/go-obscuro + git clone --depth 1 -b https://github.com/ten-protocol/go-ten.git /home/ten/go-ten ``` -#### - Start Obscuro Node +#### - Start Ten Node -To start the obscuro node some information is required to populate the starting script. +To start the ten node some information is required to populate the starting script. - (host_public_p2p_addr) The external facing address of the network. Where outside peers will connect to. Must be open to outside connections.`curl https://ipinfo.io/ip` provides the external IP. - (private_key) Private Key to issue transactions into the Layer 1 - (host_id) Public Key derived from the Private Key ``` -go run /home/obscuro/go-obscuro/go/node/cmd \ +go run /home/ten/go-ten/go/node/cmd \ -is_genesis="false" \ -node_type=validator \ -is_sgx_enabled="true" \ diff --git a/docs/_docs/testnet/tutorial.md b/docs/_docs/testnet/tutorial.md index c2d7120096..02a354bc0e 100644 --- a/docs/_docs/testnet/tutorial.md +++ b/docs/_docs/testnet/tutorial.md @@ -1,21 +1,21 @@ --- --- # Getting Started -In this tutorial, you build your own Obscuro dApp from the start. This is an excellent way to experience a typical development process as you learn how Obscuro dApps are built, design concepts, tools and terminology. +In this tutorial, you build your own Ten dApp from the start. This is an excellent way to experience a typical development process as you learn how Ten dApps are built, design concepts, tools and terminology. # Let's go -In this tutorial, we'll build a 'Guessing Game' dApp that provides an introduction to the fundamentals of Obscuro and shows you how to: -- Set up your local Ethereum development environment for Obscuro. -- Use Obscuro concepts to develop a dApp. +In this tutorial, we'll build a 'Guessing Game' dApp that provides an introduction to the fundamentals of Ten and shows you how to: +- Set up your local Ethereum development environment for Ten. +- Use Ten concepts to develop a dApp. What is the *Guessing Game*? -The Guessing Game is an example of a dApp that can only be built on Obscuro, and not on native Ethereum. +The Guessing Game is an example of a dApp that can only be built on Ten, and not on native Ethereum. -You will build a dApp that demonstrates a basic Obscuro use case, a simple number guessing game. The dApp's smart contract generates a random secret number, which is never revealed to anyone, including node operators, developers or end-user because of the privacy provided by Obscuro. The goal of the game is to guess this number, and each time an attempt is made, an entrance fee of 1 token is paid. If a user correctly guesses the number, the contract will pay out all of the accumulated entrance fees to them and reset itself with a new random number. +You will build a dApp that demonstrates a basic Ten use case, a simple number guessing game. The dApp's smart contract generates a random secret number, which is never revealed to anyone, including node operators, developers or end-user because of the privacy provided by Ten. The goal of the game is to guess this number, and each time an attempt is made, an entrance fee of 1 token is paid. If a user correctly guesses the number, the contract will pay out all of the accumulated entrance fees to them and reset itself with a new random number. -Without Obscuro, it would be possible to look up the internal state of the contract and cheat, and the game wouldn't work. +Without Ten, it would be possible to look up the internal state of the contract and cheat, and the game wouldn't work. The dApp has many of the features that you'd expect to find, including: - Generating a random number known only to the dApp. @@ -27,11 +27,11 @@ The dApp has many of the features that you'd expect to find, including: # Set up your environment - You'll need to install MetaMask following the instructions [here](https://metamask.io/) -- Then download and run the Obscuro Wallet extension following the instructions [here](https://docs.obscu.ro/wallet-extension/wallet-extension) -- Now connect MetaMask to the Obscuro testnet following the instructions [here](https://docs.obscu.ro/wallet-extension/configure-metamask) +- Then download and run the Ten Wallet extension following the instructions [here](https://docs.obscu.ro/wallet-extension/wallet-extension) +- Now connect MetaMask to the Ten testnet following the instructions [here](https://docs.obscu.ro/wallet-extension/configure-metamask) - Finally, check you can open the Remix IDE by visiting the following URL in your browser https://remix.ethereum.org -That's it. You're all set to start building your first dApp on Obscuro. +That's it. You're all set to start building your first dApp on Ten. ## 1. To begin, we'll clone a template smart contract from Github through Remix by following these instructions @@ -39,7 +39,7 @@ That's it. You're all set to start building your first dApp on Obscuro. ![Step 1 screenshot](https://images.tango.us/workflows/57863807-6b96-4295-a7a1-42da1623f030/steps/919b227f-f1f5-4af3-aba1-7fb83576d505/8144f3f5-7855-4c83-86dd-c88e5476c367.png?crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&mark-w=0.2&mark-pad=0&mark64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL21hZGUtd2l0aC10YW5nby13YXRlcm1hcmsucG5n&ar=874%3A594) -#### Paste "https://github.com/obscuronet/tutorial/blob/main/number-guessing-game/contracts/Guess.sol" into input +#### Paste "https://github.com/ten-protocol/tutorial/blob/main/number-guessing-game/contracts/Guess.sol" into input ![Step 2 screenshot](https://images.tango.us/workflows/57863807-6b96-4295-a7a1-42da1623f030/steps/4b3b212d-2518-4cc9-aab2-4befe128b38c/66a9a87d-0899-42d2-8f6a-98f204b25825.png?crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&mark-w=0.2&mark-pad=0&mark64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL21hZGUtd2l0aC10YW5nby13YXRlcm1hcmsucG5n&ar=530%3A371) @@ -48,7 +48,7 @@ That's it. You're all set to start building your first dApp on Obscuro. # Let's code -Guess.sol is a Solidity file, and once we're done, it will contain everything we need for the Guessing Game. Inside the file you'll find the classic ERC-20 interface and a simple implementation named ERC20Basic representing OGG (Obscuro Guessing Game token). We'll use OGG as a means of entry to play and to generate the prize pool. +Guess.sol is a Solidity file, and once we're done, it will contain everything we need for the Guessing Game. Inside the file you'll find the classic ERC-20 interface and a simple implementation named ERC20Basic representing OGG (Ten Guessing Game token). We'll use OGG as a means of entry to play and to generate the prize pool. There is also a skeleton contract called Guess inside Guess.sol, and this is what we'll be extending. The contract Guess will be written the same as any other Solidity contract in Ethereum. It'll run on the EVM and will exhibit the same behaviours. @@ -60,7 +60,7 @@ Let's start by defining the key variables we'll need for the game. One is to sto uint8 private _target IERC20 public erc20 ``` -Upon seeing this, you might think, hang on, I can see *_target* is set to private, but so what? Private variables in Ethereum don't really mean they're private, just that they can't be accessed or modified by other smart contracts. And you're right, that's the case in Ethereum. But in Obscuro, private variables *really* are private (unless you explicitly decide to reveal them!). This is because all contracts and contract data is encrypted and only accessible within enclaves. +Upon seeing this, you might think, hang on, I can see *_target* is set to private, but so what? Private variables in Ethereum don't really mean they're private, just that they can't be accessed or modified by other smart contracts. And you're right, that's the case in Ethereum. But in Ten, private variables *really* are private (unless you explicitly decide to reveal them!). This is because all contracts and contract data is encrypted and only accessible within enclaves. Our variables should now look like this ![Step 1 screenshot](https://images.tango.us/workflows/dc61d575-7eea-457c-bdfe-8edccf79b366/steps/3d9b387b-a492-4096-aa8a-1d50084be0d5/6d08adce-70d2-4203-8d18-c09999536553.png?crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&mark-w=0.2&mark-pad=0&mark64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL21hZGUtd2l0aC10YW5nby13YXRlcm1hcmsucG5n&ar=413%3A131) @@ -128,13 +128,13 @@ If it's not correct, we do nothing. For example, your code might look something ![Step 1 screenshot](https://images.tango.us/workflows/7073e589-7d79-491f-b4f1-27db2eb144c1/steps/ad4b9d9a-5793-420f-b21c-3a22ae8e83b5/b016b98e-203a-4362-9c14-6ff2928b9ba8.png?crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&mark-w=0.2&mark-pad=0&mark64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL21hZGUtd2l0aC10YW5nby13YXRlcm1hcmsucG5n&ar=879%3A246) -This works. You now have an Obscuro contract that will let players play the guessing game. But it's not very good. So how do players know if they've won or not? We need events! +This works. You now have an Ten contract that will let players play the guessing game. But it's not very good. So how do players know if they've won or not? We need events! -In Ethereum, events are typically written to the event log that is viewable by everyone. In Obscuro, events are viewable only to those they're intended for. This is done by encrypting events with a key that is known only to the intended recipient. This is handled automatically for the recipient through the Wallet Extension. +In Ethereum, events are typically written to the event log that is viewable by everyone. In Ten, events are viewable only to those they're intended for. This is done by encrypting events with a key that is known only to the intended recipient. This is handled automatically for the recipient through the Wallet Extension. So let's go ahead and start adding in some events. First, we'll need to emit events letting a player know after they've played whether they have won or not. -Events in Obscuro look exactly like events in any other EVM-based platform. All the complexity of ensuring privacy is abstracted away. So let's go ahead and define two new events in our contract. +Events in Ten look exactly like events in any other EVM-based platform. All the complexity of ensuring privacy is abstracted away. So let's go ahead and define two new events in our contract. ``` event Correct(address indexed player, uint8 guess, uint prize); @@ -154,7 +154,7 @@ Our function to return the prize pool is: ![Step 1 screenshot](https://images.tango.us/workflows/74ec7481-8c33-401f-8476-07c777e7cd3d/steps/d4a753b9-f507-4f6c-b080-40587ec82c00/8ffdc581-6e95-40bb-9c11-d3fa0ef01d84.png?crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&mark-w=0.2&mark-pad=0&mark64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL21hZGUtd2l0aC10YW5nby13YXRlcm1hcmsucG5n&ar=518%3A87) -And that's it! Congratulations on writing your first Obscuro smart contract! +And that's it! Congratulations on writing your first Ten smart contract! You can now go ahead and deploy the contract following the instructions [here](https://docs.obscu.ro/testnet/deploying-a-smart-contract) diff --git a/docs/_docs/wallet-extension/configure-metamask.md b/docs/_docs/wallet-extension/configure-metamask.md index 709612741a..b01a98d8d6 100644 --- a/docs/_docs/wallet-extension/configure-metamask.md +++ b/docs/_docs/wallet-extension/configure-metamask.md @@ -2,9 +2,9 @@ --- # Configuring MetaMask -To keep data encrypted between MetaMask and the Obscuro network, MetaMask needs to be configured to point to the local Wallet Extension as follows: +To keep data encrypted between MetaMask and the Ten network, MetaMask needs to be configured to point to the local Wallet Extension as follows: -* Network Name: Obscuro Testnet +* Network Name: Ten Testnet * New RPC URL: `http://127.0.0.1:3000/` * Chain ID: 443 * Currency Symbol: ETH diff --git a/docs/_docs/wallet-extension/wallet-extension.md b/docs/_docs/wallet-extension/wallet-extension.md index 439a018c32..1af5ce0ae9 100644 --- a/docs/_docs/wallet-extension/wallet-extension.md +++ b/docs/_docs/wallet-extension/wallet-extension.md @@ -1,16 +1,16 @@ --- --- -# The Obscuro Wallet Extension +# The Ten Wallet Extension -The wallet extension is the Obscuro component that ensures that sensitive information in RPC requests between client -applications and the Obscuro enclave, such as balances or transactions, cannot be seen by third parties. It -achieves this goal without requiring any custom wallet software or application code changes. Private keys for Obscuro +The wallet extension is the Ten component that ensures that sensitive information in RPC requests between client +applications and the Ten enclave, such as balances or transactions, cannot be seen by third parties. It +achieves this goal without requiring any custom wallet software or application code changes. Private keys for Ten addresses may be stored in [MetaMask](https://metamask.io/), for example, and the Wallet Extension will act as a bridge -between MetaMask and an Obscuro host without ever knowing your wallet's private keys itself. +between MetaMask and an Ten host without ever knowing your wallet's private keys itself. The wallet extension performs two functions: -* Encrypting outgoing RPC requests using the public key of the Obscuro enclave. +* Encrypting outgoing RPC requests using the public key of the Ten enclave. * Decrypting incoming RPC responses for [privacy-sensitive requests](https://docs.obscu.ro/api/sensitive-apis/) (e.g. `eth_getBalance`, `eth_call` and `eth_getTransactionReceipt`) using an address-specific _viewing key_. @@ -22,7 +22,7 @@ to securely decrypt the incoming messages. The wallet extension should be run locally by the user, such that no sensitive data leaves the client's machine unencrypted. If the data is not particularly sensitive, it can also be run in another trusted location. -This diagram shows how Wallet Extension fits into the Obscuro workflow as a bridge between standard ethereum ecosystem +This diagram shows how Wallet Extension fits into the Ten workflow as a bridge between standard ethereum ecosystem tools. ![Diagram showing wallet extension as an RPC bridge for common Ethereum tooling](../../assets/images/RPC-Interfaces.png) @@ -35,11 +35,11 @@ tools. ## Usage -1. The wallet extension can be downloaded from the [Obscuro release page](https://github.com/obscuronet/go-obscuro/releases) +1. The wallet extension can be downloaded from the [Ten release page](https://github.com/ten-protocol/go-ten/releases) where the binary is built for the Linux, MacOS and Windows platforms. Download the binary for the latest release and rename to `wallet_extension`. Note that on MacOS the binary has not been signed and notarised yet - see [apple support](https://support.apple.com/en-gb/HT202491) for steps to over-write this. The binary can be compiled by - cloning the [Obscuro repository](https://github.com/obscuronet/go-obscuro) and running the following command from the + cloning the [Ten repository](https://github.com/ten-protocol/go-ten) and running the following command from the root of the repository: ``` @@ -54,9 +54,9 @@ tools. * `port` (default: `3000`): The local port on which to serve the wallet extension. * `portWS` (default: `3001`): The local port on which to handle websocket requests. - * `nodeHost` (default: `erpc.sepolia-testnet.obscu.ro`): The Obscuro node for the RPC connection. - * `nodePortHTTP` (default: `80`): The Obscuro node's HTTP RPC port. - * `nodePortWS` (default: `81`): The Obscuro node's websockets RPC port. + * `nodeHost` (default: `erpc.sepolia-testnet.obscu.ro`): The Ten node for the RPC connection. + * `nodePortHTTP` (default: `80`): The Ten node's HTTP RPC port. + * `nodePortWS` (default: `81`): The Ten node's websockets RPC port. * `logPath` (default: `wallet_extension_logs.txt`): The path for the wallet extension's logs. * `databasePath` (default: `~/.obscuro/getway_database`): The path to use for the wallet extension's database. @@ -64,7 +64,7 @@ tools. The wallet extension is now listening on the specified host and port. For the remainder of this document, we'll assume that the default ports of `3000` and `3001` were selected. -3. Sign in to MetaMask and add the Obscuro Testnet network following the instructions [here](https://docs.obscu.ro/wallet-extension/configure-metamask). +3. Sign in to MetaMask and add the Ten Testnet network following the instructions [here](https://docs.obscu.ro/wallet-extension/configure-metamask). 4. At this stage, no viewing key has been set up. The enclave will refuse to respond to sensitive RPC requests such as `eth_getBalance`, `eth_call` and `eth_getTransactionReceipt`. As a result, your balance in MetaMask will not be @@ -79,4 +79,4 @@ tools. # Auditing the source -The source code for the wallet extension can be found [here](https://github.com/obscuronet/go-obscuro/tree/main/tools/walletextension). +The source code for the wallet extension can be found [here](https://github.com/ten-protocol/go-ten/tree/main/tools/walletextension). diff --git a/docs/_docs/what-is-obscuro/encrypted-ethereum.md b/docs/_docs/what-is-obscuro/encrypted-ethereum.md index 064842d1f7..34397ad0c5 100644 --- a/docs/_docs/what-is-obscuro/encrypted-ethereum.md +++ b/docs/_docs/what-is-obscuro/encrypted-ethereum.md @@ -3,6 +3,6 @@ # Encrypted Ethereum _The full Litepaper is available to view [here](https://obscu.ro/litepaper)._ -Obscuro brings to Ethereum what HTTPS brought to Web 2 leading to an explosion in applications and usage. Obscuro achieves this goal by building an encrypted Ethereum Layer 2, leveraging the consensus and security of Ethereum. +Ten brings to Ethereum what HTTPS brought to Web 2 leading to an explosion in applications and usage. Ten achieves this goal by building an encrypted Ethereum Layer 2, leveraging the consensus and security of Ethereum. -As a Layer 2 solution, Obscuro enables faster and more cost-effective transactions while inheriting the security of Ethereum. Obscuro ensures that all inputs, contract state, and execution processes are encrypted, providing a Web2 experience with no changes to the user or developer experience. Obscuro revolutionizes Web3 applications, including gaming, DeFi 2.0, dark pool trading, sealed auctions, private agreements, identity, and more. \ No newline at end of file +As a Layer 2 solution, Ten enables faster and more cost-effective transactions while inheriting the security of Ethereum. Ten ensures that all inputs, contract state, and execution processes are encrypted, providing a Web2 experience with no changes to the user or developer experience. Ten revolutionizes Web3 applications, including gaming, DeFi 2.0, dark pool trading, sealed auctions, private agreements, identity, and more. \ No newline at end of file diff --git a/docs/_docs/what-is-obscuro/privacy-matters.md b/docs/_docs/what-is-obscuro/privacy-matters.md index 671df7fef8..30dfcba61b 100644 --- a/docs/_docs/what-is-obscuro/privacy-matters.md +++ b/docs/_docs/what-is-obscuro/privacy-matters.md @@ -3,16 +3,16 @@ # Privacy _The full Litepaper is available to view [here](https://obscu.ro/litepaper)._ -The privacy Obscuro provides can be split into transactional and computational privacy. +The privacy Ten provides can be split into transactional and computational privacy. ## Transactional privacy Transactional privacy is the ability to maintain privacy over transactions on the L2. For example, keeping user token balances, participants of a transaction and the amounts transferred private is the main use of transactional privacy. This is the problem that ZKP-based privacy protocols such as Z-Cash solve. -Obscuro provides transactional privacy and keeps token contract calls entirely confidential by encrypting transactions from the point of origination, the wallet. +Ten provides transactional privacy and keeps token contract calls entirely confidential by encrypting transactions from the point of origination, the wallet. ## Computational privacy -In addition to transactional privacy, Obscuro also provides a much deeper form of privacy known as computational privacy. This is complete and absolute privacy over the entire computation of smart contracts and the network. +In addition to transactional privacy, Ten also provides a much deeper form of privacy known as computational privacy. This is complete and absolute privacy over the entire computation of smart contracts and the network. With computational privacy, it's possible to keep inputs and outputs from contracts private and any logic executed within the smart contract. This opens up huge possibilities across DeFi, NFTs, Gaming, DAOs, the Metaverse and things yet to come. \ No newline at end of file diff --git a/docs/_docs/what-is-obscuro/quick-start.md b/docs/_docs/what-is-obscuro/quick-start.md index ea420665d8..0016241ade 100644 --- a/docs/_docs/what-is-obscuro/quick-start.md +++ b/docs/_docs/what-is-obscuro/quick-start.md @@ -2,22 +2,22 @@ --- # Developer quick start -The only difference between an Obscuro and an Ethereum (or Arbitrum) dApp is that on Obscuro you can hide the internal +The only difference between an Ten and an Ethereum (or Arbitrum) dApp is that on Ten you can hide the internal state of the contract. -The most obvious example is that an ERC20 token deployed on Obscuro will not respond to balance requests unless you are +The most obvious example is that an ERC20 token deployed on Ten will not respond to balance requests unless you are the account owner. -In Obscuro, the internal node database is encrypted, and the contract execution is also encrypted inside the TEE. +In Ten, the internal node database is encrypted, and the contract execution is also encrypted inside the TEE. The calls to [getStorageAt](https://docs.alchemy.com/reference/eth-getstorageat) are disabled, so all data access requests will be performed through view functions which are under the control of the smart contract developer. Nobody (which includes node operators and the sequencer) can access the internal state of a contract. -**The only thing you have to do when porting a dApp to Obscuro is to add a check in your view functions comparing +**The only thing you have to do when porting a dApp to Ten is to add a check in your view functions comparing the `tx.origing` and `msg.sender` against the accounts allowed to access that data.** -The snippet below illustrates this for an [ERC20 token](https://github.com/obscuronet/sample-applications/blob/main/number-guessing-game/contracts/ERC20.sol#L25). +The snippet below illustrates this for an [ERC20 token](https://github.com/ten-protocol/sample-applications/blob/main/number-guessing-game/contracts/ERC20.sol#L25). ```solidity function balanceOf(address tokenOwner) public view override returns (uint256) { @@ -26,4 +26,4 @@ function balanceOf(address tokenOwner) public view override returns (uint256) { } ``` -_Note that this works because in Obscuro all calls to view functions are authenticated._ \ No newline at end of file +_Note that this works because in Ten all calls to view functions are authenticated._ \ No newline at end of file diff --git a/docs/_docs/what-is-obscuro/technology.md b/docs/_docs/what-is-obscuro/technology.md index 18c17de95c..5bc631f9d7 100644 --- a/docs/_docs/what-is-obscuro/technology.md +++ b/docs/_docs/what-is-obscuro/technology.md @@ -2,6 +2,6 @@ --- # Technology -Obscuro leverages a pragmatic technology for encrypting the ledger, Trusted Execution Environments (TEEs). TEEs provide robust confidentiality guarantees with certainty over the code running. They allow Obscuro to offer smart contracts, decentralisation, scalability and encryption in a way not seen before. +Ten leverages a pragmatic technology for encrypting the ledger, Trusted Execution Environments (TEEs). TEEs provide robust confidentiality guarantees with certainty over the code running. They allow Ten to offer smart contracts, decentralisation, scalability and encryption in a way not seen before. -Obscuro brings encryption to the Ethereum Mainnet, leveraging the liveness and availability of the Mainnet for ledger integrity. Uniquely, Obscuro’s Proof of Block Inclusion (POBI) protocol ensures Obscuro's confidential roll-ups have consensus in a decentralized Obscuro network. \ No newline at end of file +Ten brings encryption to the Ethereum Mainnet, leveraging the liveness and availability of the Mainnet for ledger integrity. Uniquely, Ten’s Proof of Block Inclusion (POBI) protocol ensures Ten's confidential roll-ups have consensus in a decentralized Ten network. \ No newline at end of file diff --git a/docs/_docs/what-is-obscuro/user-experience.md b/docs/_docs/what-is-obscuro/user-experience.md index e0b1dc33ce..7480267188 100644 --- a/docs/_docs/what-is-obscuro/user-experience.md +++ b/docs/_docs/what-is-obscuro/user-experience.md @@ -2,6 +2,6 @@ --- # User Experience -The design of Obscuro ensures that existing Ethereum dApps can move over to Obscuro for virtually no cost. Any developer familiar with Ethereum can build encrypted dApps on Obscuro that benefit from the adoption, legitimacy, security, developer tooling and liquidity of the entire Ethereum ecosystem. +The design of Ten ensures that existing Ethereum dApps can move over to Ten for virtually no cost. Any developer familiar with Ethereum can build encrypted dApps on Ten that benefit from the adoption, legitimacy, security, developer tooling and liquidity of the entire Ethereum ecosystem. -End-users can continue to use MetaMask or their favourite Ethereum wallet. Interacting with an Obscuro application is the same as interacting with any Ethereum application. With a seamless user and developer experience, Obscuro changes the paradigm around encryption for web3. +End-users can continue to use MetaMask or their favourite Ethereum wallet. Interacting with an Ten application is the same as interacting with any Ethereum application. With a seamless user and developer experience, Ten changes the paradigm around encryption for web3. diff --git a/docs/index.md b/docs/index.md index f78efcb44a..d39421ad95 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,11 +2,11 @@

-Welcome to Obscuro - the first Ethereum L2 with private smart contract state. +Welcome to Ten - the first Ethereum L2 with private smart contract state. -Obscuro hyper-scales and encrypts Ethereum. 100% EVM, 100% Solidity. +Ten hyper-scales and encrypts Ethereum. 100% EVM, 100% Solidity. -On this docsite you will find useful guidance on Obscuro, how to participate in the Testnet and, if you want to go deeper, read the whitepaper using the menu above. +On this docsite you will find useful guidance on Ten, how to participate in the Testnet and, if you want to go deeper, read the whitepaper using the menu above. The Litepaper is available to view [here](https://obscu.ro/litepaper). @@ -15,7 +15,7 @@ A PDF version of the whitepaper is available [here](https://whitepaper.obscu.ro/ ## Useful Resources -1. [Github](https://github.com/obscuronet/go-obscuro) -2. [Twitter](https://twitter.com/obscuronet/) +1. [Github](https://github.com/ten-protocol/go-ten) +2. [Twitter](https://twitter.com/tenprotocol/) 3. [Discord](https://discord.gg/7pkKv2Tyfn) 4. [Blog](https://medium.com/obscuro-labs) diff --git a/go.mod b/go.mod index b2953e40b1..d988d82248 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/obscuronet/go-obscuro +module github.com/ten-protocol/go-ten go 1.20 @@ -30,6 +30,7 @@ require ( github.com/tidwall/gjson v1.11.0 github.com/valyala/fasthttp v1.48.0 golang.org/x/crypto v0.12.0 + golang.org/x/exp v0.0.0-20230810033253-352e893a4cad golang.org/x/sync v0.3.0 google.golang.org/grpc v1.53.0 google.golang.org/protobuf v1.30.0 @@ -134,7 +135,6 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/exp v0.0.0-20230810033253-352e893a4cad // indirect golang.org/x/mod v0.11.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/sys v0.11.0 // indirect diff --git a/go.sum b/go.sum index 2a2657a0c5..d789698b79 100644 --- a/go.sum +++ b/go.sum @@ -1,19 +1,151 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= +cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= +cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= +cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= +cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= +cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= +cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= +cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= +cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= +cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= +cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= +cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= +cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= +cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= +cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= +cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= +cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= +cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= +cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= +cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= +cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= +cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= +cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= +cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= +cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= +cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= +cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= +cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= +cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= +cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= +cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= +cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= +cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= +cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/CloudyKit/jet/v6 v6.1.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/hcsshim v0.10.0-rc.8/go.mod h1:OEthFdQv/AD2RAdzR6Mm1N1KPCztGKDurW1Z8b8VGMM= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= @@ -28,6 +160,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= @@ -45,6 +178,16 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= +github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= +github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -53,11 +196,13 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= @@ -73,17 +218,24 @@ github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= @@ -96,27 +248,51 @@ github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoG github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811/go.mod h1:Nb5lgvnQ2+oGlE/EyZy4+2/CxRh9KfvCXnag1vtpxVM= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.10.0 h1:zRh22SR7o4K35SoNqouS9J/TKHTyU2QWaj5ldehyXtA= github.com/consensys/gnark-crypto v0.10.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnxoKK5nVyZKd+/KhU= +github.com/container-orchestrated-devices/container-device-interface v0.5.4/go.mod h1:DjE95rfPiiSmG7uVXtg0z6MnPm/Lx4wxKCIts0ZE0vg= +github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/btrfs/v2 v2.0.0/go.mod h1:swkD/7j9HApWpzl8OHfrHNxppPd9l44DFZdF94BUj9k= +github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= +github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o= github.com/containerd/containerd v1.7.3/go.mod h1:32FOM4/O0RkNg7AjQj3hDzN9cUGtu+HMvaKUNiqCZB8= +github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= +github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/imgcrypt v1.1.7/go.mod h1:FD8gqIcX5aTotCtOmjeCsi3A1dHmTZpnMISGKSczt4k= +github.com/containerd/nri v0.3.0/go.mod h1:Zw9q2lP16sdg0zYybemZ9yTDy8g7fPCIB3KXOGlggXI= +github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= +github.com/containerd/zfs v1.1.0/go.mod h1:oZF9wBnrnQjpWLaPKEinrx3TQ9a+W/RJO7Zb41d8YLE= +github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= +github.com/containernetworking/plugins v1.2.0/go.mod h1:/VjX4uHecW5vVimFa1wkG4s+r/s9qIfPdqlLF4TW8c4= +github.com/containers/ocicrypt v1.1.6/go.mod h1:WgjxPWdTJMqYMjf3M6cuIFFA1/MpyyhIM99YInA+Rvc= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-ipa v0.0.0-20230601170251-1830d0757c80/go.mod h1:gzbVz57IDJgQ9rLQwfSk696JGWof8ftznEL9GoAv3NI= github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A= github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -125,20 +301,26 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.3-0.20220224222438-c78f6963a1c0+incompatible h1:Ptj2To+ezU/mCBUKdYXBQ2r3/2EJojAlOZrsgprF+is= github.com/docker/docker v20.10.3-0.20220224222438-c78f6963a1c0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -152,11 +334,14 @@ github.com/eko/gocache/lib/v4 v4.1.2 h1:cX54GhJJsfc5jvCEaPW8595h9Pq6bbNfkv0o/669 github.com/eko/gocache/lib/v4 v4.1.2/go.mod h1:FqyrANKct257VFHVVs11m6V2syGobOmHycQCyRSMwu0= github.com/eko/gocache/store/bigcache/v4 v4.1.2 h1:8uMDpgxTG7BvyLHBFqL3Ao809bVrXfrWqo7v6ALiwTw= github.com/eko/gocache/store/bigcache/v4 v4.1.2/go.mod h1:Lut5Sk/yI835w02tmwx4ecezYQo445L5sdICsk1zgho= +github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.3.1 h1:sR65+68+WdnMKxseNWxSJuAv2tsUrihTpVBTfM/U5Zg= github.com/ethereum/c-kzg-4844 v0.3.1/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= @@ -165,8 +350,10 @@ github.com/ethereum/go-ethereum v1.12.2/go.mod h1:1cRAEV+rp/xX0zraSCBnu9Py3HQ+ge github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -175,12 +362,15 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gballet/go-verkle v0.0.0-20230607174250-df487255f46b/go.mod h1:CDncRYVRSDqwakm282WEkjfaAj1hxU/v5RXxk5nXOiI= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= +github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g= github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs= @@ -194,20 +384,25 @@ github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SU github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -217,6 +412,7 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -229,6 +425,7 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -245,8 +442,10 @@ github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzq github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= @@ -280,8 +479,11 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -290,6 +492,7 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -297,18 +500,23 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -335,20 +543,30 @@ github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/intel/goresctrl v0.3.0/go.mod h1:fdz3mD85cmP9sHD8JUlrNWAxvwM86CrbmVXltEKd7zk= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/jade v1.1.4/go.mod h1:EDqR+ur9piDl6DUgs6qRrlfzmlx/D5UybogqrXvJTBE= github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -358,12 +576,21 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= +github.com/karalabe/usb v0.0.3-0.20230711191512-61db3e06439c/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= +github.com/kataras/golog v0.1.7/go.mod h1:jOSQ+C5fUqsNSwurB/oAHq1IFSb0KI3l6GMa7xB6dZA= github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= +github.com/kataras/iris/v12 v12.2.0-beta5/go.mod h1:q26aoWJ0Knx/00iPKg5iizDK7oQQSPjbD8np0XDh6dc= github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= +github.com/kataras/pio v0.0.11/go.mod h1:38hH6SWH6m4DKSYmRhlrCJ5WItwWgCVrTNU62XZyUvI= github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4= +github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= +github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -388,9 +615,13 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= +github.com/labstack/echo/v4 v4.9.0/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= @@ -398,6 +629,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailgun/raymond/v2 v2.0.46/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -425,7 +658,11 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -442,6 +679,12 @@ github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8oh github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= +github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -455,6 +698,7 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 h1:shk/vn9oCoOTmwcouEdwIeOtOGA/ELRUw/GwvxwfT+0= @@ -489,6 +733,10 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runtime-spec v1.1.0-rc.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626/go.mod h1:BRHJJd0E+cx42OybVYSgUvZmU0B8P9gZuRXlZUP7TKI= +github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -501,10 +749,12 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -543,6 +793,7 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7/go.mod h1:IToEjHuttnUzwZI5KBSM/LOOW3qLbbrHOEfp3SbECGY= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -554,6 +805,7 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -580,12 +832,15 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= +github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -609,8 +864,12 @@ github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gt github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= +github.com/tdewolff/minify/v2 v2.12.4/go.mod h1:h+SRvSIX3kwgwTFOpSckvSxgax3uy8kZTSF1Ojrr3bk= +github.com/tdewolff/parse/v2 v2.6.4/go.mod h1:woz0cgbLwFdtbjJu8PIKxhW05KplTFQkOdX78o+Jgrs= github.com/tidwall/gjson v1.11.0 h1:C16pk7tQNiH6VlCrtIXL1w8GaOsi1X3W8KDkE1BuYd4= github.com/tidwall/gjson v1.11.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= @@ -636,6 +895,7 @@ github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4d github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= @@ -647,6 +907,12 @@ github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= +github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= @@ -655,19 +921,35 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= +github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0/go.mod h1:UMklln0+MRhZC4e3PwmN3pCtq4DyIadWw4yikh6bNrw= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4= +go.opentelemetry.io/otel/metric v0.37.0/go.mod h1:DmdaHfGt54iV6UKxsV9slj2bBRJcKC1B1uvDLIioc1s= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= @@ -741,6 +1023,7 @@ golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -801,6 +1084,7 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -813,6 +1097,7 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -841,6 +1126,7 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -898,7 +1184,9 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= @@ -928,8 +1216,19 @@ honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.26.2/go.mod h1:1kjMQsFE+QHPfskEcVNgL3+Hp88B80uj0QtSOlj8itU= +k8s.io/apimachinery v0.26.2/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= +k8s.io/apiserver v0.26.2/go.mod h1:GHcozwXgXsPuOJ28EnQ/jXEM9QeG6HT22YxSNmpYNh8= +k8s.io/client-go v0.26.2/go.mod h1:u5EjOuSyBa09yqqyY7m3abZeovO/7D/WehVVlZ2qcqU= +k8s.io/component-base v0.26.2/go.mod h1:DxbuIe9M3IZPRxPIzhch2m1eT7uFrSBJUBuVCQEBivs= +k8s.io/cri-api v0.27.1/go.mod h1:+Ts/AVYbIo04S86XbTD73UPp/DkTiYxtsFeOFEu32L0= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/go/common/constants/contract.go b/go/common/constants/contract.go index 616c0cf1b8..ffe02e750f 100644 --- a/go/common/constants/contract.go +++ b/go/common/constants/contract.go @@ -2,7 +2,7 @@ package constants import ( "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" + "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" ) func Bytecode() ([]byte, error) { diff --git a/go/common/enclave.go b/go/common/enclave.go index 1027935704..14718089be 100644 --- a/go/common/enclave.go +++ b/go/common/enclave.go @@ -4,11 +4,11 @@ import ( "encoding/json" "math/big" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common/tracers" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/common/tracers" + "github.com/ten-protocol/go-ten/go/responses" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/common/gethdb/geth_inmemdb.go b/go/common/gethdb/geth_inmemdb.go index 1c34d259e7..41cc2dddb9 100644 --- a/go/common/gethdb/geth_inmemdb.go +++ b/go/common/gethdb/geth_inmemdb.go @@ -3,7 +3,7 @@ package gethdb import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" ) type InMemGethDB struct { diff --git a/go/common/gethencoding/geth_encoding.go b/go/common/gethencoding/geth_encoding.go index fe0d04204c..14bf4c91ad 100644 --- a/go/common/gethencoding/geth_encoding.go +++ b/go/common/gethencoding/geth_encoding.go @@ -7,12 +7,14 @@ import ( "strings" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" + "github.com/ethereum/go-ethereum/trie" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/gethapi" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/gethapi" gethcommon "github.com/ethereum/go-ethereum/common" gethrpc "github.com/ethereum/go-ethereum/rpc" @@ -243,7 +245,7 @@ func CreateEthHeaderForBatch(h *common.BatchHeader, secret []byte) (*types.Heade Difficulty: big.NewInt(0), Number: h.Number, GasLimit: h.GasLimit, - GasUsed: 0, + GasUsed: h.GasUsed, BaseFee: big.NewInt(0).SetUint64(baseFee), Coinbase: h.Coinbase, Time: h.Time, @@ -252,6 +254,15 @@ func CreateEthHeaderForBatch(h *common.BatchHeader, secret []byte) (*types.Heade }, nil } +func CreateEthBlockFromBatch(b *core.Batch) (*types.Block, error) { + blockHeader, err := CreateEthHeaderForBatch(b.Header, nil) + if err != nil { + return nil, fmt.Errorf("unable to create eth block from batch - %w", err) + } + + return types.NewBlock(blockHeader, b.Transactions, nil, nil, trie.NewStackTrie(nil)), nil +} + // DecodeParamBytes decodes the parameters byte array into a slice of interfaces // Helps each calling method to manage the positional data func DecodeParamBytes(paramBytes []byte) ([]interface{}, error) { diff --git a/go/common/gethutil/gethutil.go b/go/common/gethutil/gethutil.go index 2c3809112e..346cfdc15a 100644 --- a/go/common/gethutil/gethutil.go +++ b/go/common/gethutil/gethutil.go @@ -4,11 +4,11 @@ import ( "bytes" "fmt" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // Utilities for working with geth structures diff --git a/go/common/headers.go b/go/common/headers.go index 820cc5adf5..8052324bb7 100644 --- a/go/common/headers.go +++ b/go/common/headers.go @@ -6,12 +6,13 @@ import ( "math/big" "sync" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" "golang.org/x/crypto/sha3" ) @@ -45,32 +46,83 @@ type BatchHeader struct { TransfersTree common.Hash `json:"transfersTree"` // This is a merkle tree of all of the outbound value transfers for the MainNet } +type batchHeaderEncoding struct { + ParentHash L2BatchHash `json:"parentHash"` + Root common.Hash `json:"stateRoot"` + TxHash common.Hash `json:"transactionsRoot"` + ReceiptHash common.Hash `json:"receiptsRoot"` + Number *hexutil.Big `json:"number"` + SequencerOrderNo *hexutil.Big `json:"sequencerOrderNo"` + GasLimit hexutil.Uint64 `json:"gasLimit"` + GasUsed hexutil.Uint64 `json:"gasUsed"` + Time hexutil.Uint64 `json:"timestamp"` + Extra []byte `json:"extraData"` + BaseFee *hexutil.Big `json:"baseFeePerGas"` + Coinbase *common.Address `json:"miner"` + + // The custom Obscuro fields. + L1Proof L1BlockHash `json:"l1Proof"` // the L1 block used by the enclave to generate the current batch + R, S *hexutil.Big // signature values + CrossChainMessages []MessageBus.StructsCrossChainMessage `json:"crossChainMessages"` + LatestInboundCrossChainHash common.Hash `json:"inboundCrossChainHash"` // The block hash of the latest block that has been scanned for cross chain messages. + LatestInboundCrossChainHeight *hexutil.Big `json:"inboundCrossChainHeight"` // The block height of the latest block that has been scanned for cross chain messages. + TransfersTree common.Hash +} + // MarshalJSON custom marshals the BatchHeader into a json func (b *BatchHeader) MarshalJSON() ([]byte, error) { - type Alias BatchHeader - return json.Marshal(struct { - *Alias - Hash common.Hash `json:"hash"` - UncleHash *common.Hash `json:"sha3Uncles"` - Coinbase *common.Address `json:"miner"` - Bloom *types.Bloom `json:"logsBloom"` - Difficulty *big.Int `json:"difficulty"` - Nonce *types.BlockNonce `json:"nonce"` - - // BaseFee was added by EIP-1559 and is ignored in legacy headers. - BaseFee *big.Int `json:"baseFeePerGas"` - }{ - (*Alias)(b), - b.Hash(), - nil, + return json.Marshal(batchHeaderEncoding{ + b.ParentHash, + b.Root, + b.TxHash, + b.ReceiptHash, + (*hexutil.Big)(b.Number), + (*hexutil.Big)(b.SequencerOrderNo), + hexutil.Uint64(b.GasLimit), + hexutil.Uint64(b.GasUsed), + hexutil.Uint64(b.Time), + b.Extra, + (*hexutil.Big)(b.BaseFee), &b.Coinbase, - nil, - nil, - nil, - b.BaseFee, + b.L1Proof, + (*hexutil.Big)(b.R), + (*hexutil.Big)(b.S), + b.CrossChainMessages, + b.LatestInboundCrossChainHash, + (*hexutil.Big)(b.LatestInboundCrossChainHeight), + b.TransfersTree, }) } +func (b *BatchHeader) UnmarshalJSON(data []byte) error { + dec := new(batchHeaderEncoding) + err := json.Unmarshal(data, dec) + if err != nil { + return err + } + + b.ParentHash = dec.ParentHash + b.Root = dec.Root + b.TxHash = dec.TxHash + b.ReceiptHash = dec.ReceiptHash + b.Number = (*big.Int)(dec.Number) + b.SequencerOrderNo = (*big.Int)(dec.SequencerOrderNo) + b.GasLimit = uint64(dec.GasLimit) + b.GasUsed = uint64(dec.GasUsed) + b.Time = uint64(dec.Time) + b.Extra = dec.Extra + b.BaseFee = (*big.Int)(dec.BaseFee) + b.Coinbase = *dec.Coinbase + b.L1Proof = dec.L1Proof + b.R = (*big.Int)(dec.R) + b.S = (*big.Int)(dec.S) + b.CrossChainMessages = dec.CrossChainMessages + b.LatestInboundCrossChainHash = dec.LatestInboundCrossChainHash + b.LatestInboundCrossChainHeight = (*big.Int)(dec.LatestInboundCrossChainHeight) + b.TransfersTree = dec.TransfersTree + return nil +} + // RollupHeader is a public / plaintext struct that holds common properties of rollups. // All these fields are processed by the Management contract type RollupHeader struct { diff --git a/go/common/headers_test.go b/go/common/headers_test.go index c691d87aac..42fe22fadd 100644 --- a/go/common/headers_test.go +++ b/go/common/headers_test.go @@ -15,7 +15,7 @@ func TestBatchHeader_MarshalJSON(t *testing.T) { Root: randomHash(), TxHash: randomHash(), ReceiptHash: randomHash(), - Number: gethcommon.Big0, + Number: gethcommon.Big1, SequencerOrderNo: gethcommon.Big1, GasLimit: 100, GasUsed: 200, diff --git a/go/common/host/host.go b/go/common/host/host.go index 7cfe017496..10dbd63377 100644 --- a/go/common/host/host.go +++ b/go/common/host/host.go @@ -3,10 +3,10 @@ package host import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/host/db" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/host/db" + "github.com/ten-protocol/go-ten/go/responses" ) // Host is the half of the Obscuro node that lives outside the enclave. diff --git a/go/common/host/identity.go b/go/common/host/identity.go index 6e5cf5cef5..d253e60d59 100644 --- a/go/common/host/identity.go +++ b/go/common/host/identity.go @@ -2,8 +2,8 @@ package host import ( gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/config" ) type Identity struct { diff --git a/go/common/host/services.go b/go/common/host/services.go index af2e8e63a1..db73a52cdf 100644 --- a/go/common/host/services.go +++ b/go/common/host/services.go @@ -4,12 +4,12 @@ import ( "math/big" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/responses" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/ethadapter" ) // service names - these are the keys used to register known services with the host @@ -101,10 +101,8 @@ type L1Publisher interface { InitializeSecret(attestation *common.AttestationReport, encSecret common.EncryptedSharedEnclaveSecret) error // RequestSecret will send a management contract transaction to request a secret from the enclave, returning the L1 head at time of sending RequestSecret(report *common.AttestationReport) (gethcommon.Hash, error) - // ExtractSecretResponses will return all secret response tx from an L1 block - ExtractSecretResponses(block *types.Block) []*ethadapter.L1RespondSecretTx - // ExtractRollupTxs will return all rollup txs from an L1 block - ExtractRollupTxs(block *types.Block) []*ethadapter.L1RollupTx + // ExtractObscuroRelevantTransactions will return all Obscuro relevant tx from an L1 block + ExtractObscuroRelevantTransactions(block *types.Block) ([]*ethadapter.L1RespondSecretTx, []*ethadapter.L1RollupTx, []*ethadapter.L1SetImportantContractsTx) // PublishRollup will create and publish a rollup tx to the management contract - fire and forget we don't wait for receipt // todo (#1624) - With a single sequencer, it is problematic if rollup publication fails; handle this case better PublishRollup(producedRollup *common.ExtRollup) @@ -114,6 +112,11 @@ type L1Publisher interface { FetchLatestPeersList() ([]string, error) FetchLatestSeqNo() (*big.Int, error) + + // GetImportantContracts returns a (cached) record of addresses of the important network contracts + GetImportantContracts() map[string]gethcommon.Address + // ResyncImportantContracts will fetch the latest important contracts from the management contract, update the cache + ResyncImportantContracts() error } // L2BatchRepository provides an interface for the host to request L2 batch data (live-streaming and historical) diff --git a/go/common/log_events.go b/go/common/log_events.go index b07d0be5ba..c5a9bb0c41 100644 --- a/go/common/log_events.go +++ b/go/common/log_events.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/enclave/vkhandler" + "github.com/ten-protocol/go-ten/go/enclave/vkhandler" ) // LogSubscription is an authenticated subscription to logs. diff --git a/go/common/query_types.go b/go/common/query_types.go index 596a4e4341..9648e4b597 100644 --- a/go/common/query_types.go +++ b/go/common/query_types.go @@ -89,4 +89,5 @@ type ObscuroNetworkInfo struct { L1StartHash common.Hash SequencerID common.Address MessageBusAddress common.Address + ImportantContracts map[string]common.Address // map of contract name to address } diff --git a/go/common/rpc/converters.go b/go/common/rpc/converters.go index fcfe695600..71d8310409 100644 --- a/go/common/rpc/converters.go +++ b/go/common/rpc/converters.go @@ -4,9 +4,9 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/rpc/generated" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/rpc/generated" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/common/tracers/native/tracer.go b/go/common/tracers/native/tracer.go index 7b8bdb5682..199e8b3110 100644 --- a/go/common/tracers/native/tracer.go +++ b/go/common/tracers/native/tracer.go @@ -45,7 +45,7 @@ package native //import ( // "errors" // -// "github.com/obscuronet/go-obscuro/go/common/tracers" +// "github.com/ten-protocol/go-ten/go/common/tracers" //) // //// init registers itself this packages as a lookup for tracers. diff --git a/go/common/types.go b/go/common/types.go index 9fcdae1530..d3afa6def0 100644 --- a/go/common/types.go +++ b/go/common/types.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" ) type ( diff --git a/go/common/viewingkey/viewing_key.go b/go/common/viewingkey/viewing_key.go index 79ff803f48..b5c740774d 100644 --- a/go/common/viewingkey/viewing_key.go +++ b/go/common/viewingkey/viewing_key.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/wallet" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/config/enclave_config.go b/go/config/enclave_config.go index db0d3998d1..7471c3b391 100644 --- a/go/config/enclave_config.go +++ b/go/config/enclave_config.go @@ -3,11 +3,11 @@ package config import ( "math/big" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/go/config/host_config.go b/go/config/host_config.go index 5fb6348776..23fa494257 100644 --- a/go/config/host_config.go +++ b/go/config/host_config.go @@ -3,7 +3,7 @@ package config import ( "time" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" diff --git a/go/enclave/components/attestation.go b/go/enclave/components/attestation.go index 7ca21f857f..3104649e95 100644 --- a/go/enclave/components/attestation.go +++ b/go/enclave/components/attestation.go @@ -6,7 +6,7 @@ import ( "encoding/json" "fmt" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/edgelesssys/ego/enclave" gethcommon "github.com/ethereum/go-ethereum/common" diff --git a/go/enclave/components/batch_executor.go b/go/enclave/components/batch_executor.go index 0d69e88ba0..82e804b625 100644 --- a/go/enclave/components/batch_executor.go +++ b/go/enclave/components/batch_executor.go @@ -8,8 +8,8 @@ import ( "sort" "sync" - "github.com/obscuronet/go-obscuro/go/enclave/gas" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/gas" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rlp" @@ -19,14 +19,14 @@ import ( gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/trie" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/measure" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/crosschain" - "github.com/obscuronet/go-obscuro/go/enclave/evm" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crosschain" + "github.com/ten-protocol/go-ten/go/enclave/evm" + "github.com/ten-protocol/go-ten/go/enclave/genesis" ) var ErrNoTransactionsToProcess = fmt.Errorf("no transactions to process") @@ -208,7 +208,8 @@ func (executor *batchExecutor) ComputeBatch(context *BatchExecutionContext, fail return nil, fmt.Errorf("failed adding cross chain data to batch. Cause: %w", err) } - executor.populateHeader(©Batch, allReceipts(txReceipts, ccReceipts)) + allReceipts := append(txReceipts, ccReceipts...) + executor.populateHeader(©Batch, allReceipts) if failForEmptyBatch && len(txReceipts) == 0 && len(ccReceipts) == 0 && @@ -220,7 +221,7 @@ func (executor *batchExecutor) ComputeBatch(context *BatchExecutionContext, fail } // the logs and receipts produced by the EVM have the wrong hash which must be adjusted - for _, receipt := range txReceipts { + for _, receipt := range allReceipts { receipt.BlockHash = copyBatch.Hash() for _, l := range receipt.Logs { l.BlockHash = copyBatch.Hash() @@ -229,7 +230,7 @@ func (executor *batchExecutor) ComputeBatch(context *BatchExecutionContext, fail return &ComputedBatch{ Batch: ©Batch, - Receipts: txReceipts, + Receipts: allReceipts, Commit: func(deleteEmptyObjects bool) (gethcommon.Hash, error) { executor.stateDBMutex.Lock() defer executor.stateDBMutex.Unlock() @@ -429,10 +430,6 @@ func (executor *batchExecutor) processTransactions( return executedTransactions, excludedTransactions, txReceipts, nil } -func allReceipts(txReceipts []*types.Receipt, depositReceipts []*types.Receipt) types.Receipts { - return append(txReceipts, depositReceipts...) -} - type sortByTxIndex []*types.Receipt func (c sortByTxIndex) Len() int { return len(c) } diff --git a/go/enclave/components/batch_registry.go b/go/enclave/components/batch_registry.go index ad2200dbf2..7aecdef54d 100644 --- a/go/enclave/components/batch_registry.go +++ b/go/enclave/components/batch_registry.go @@ -7,16 +7,16 @@ import ( "sync" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" "github.com/ethereum/go-ethereum/core/state" gethlog "github.com/ethereum/go-ethereum/log" gethrpc "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/measure" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/limiters" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/limiters" ) type batchRegistry struct { diff --git a/go/enclave/components/block_processor.go b/go/enclave/components/block_processor.go index 92f2448610..13ea6edbcd 100644 --- a/go/enclave/components/block_processor.go +++ b/go/enclave/components/block_processor.go @@ -4,19 +4,19 @@ import ( "errors" "fmt" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/gas" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/gas" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/gethutil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/measure" - "github.com/obscuronet/go-obscuro/go/enclave/crosschain" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/enclave/crosschain" ) type l1BlockProcessor struct { diff --git a/go/enclave/components/interfaces.go b/go/enclave/components/interfaces.go index a16e96d2ad..12b696ce97 100644 --- a/go/enclave/components/interfaces.go +++ b/go/enclave/components/interfaces.go @@ -9,9 +9,9 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" gethrpc "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/limiters" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/limiters" ) var ErrDuplicateRollup = errors.New("duplicate rollup received") diff --git a/go/enclave/components/rollup_compression.go b/go/enclave/components/rollup_compression.go index fdc1644534..0034d48cc7 100644 --- a/go/enclave/components/rollup_compression.go +++ b/go/enclave/components/rollup_compression.go @@ -9,19 +9,19 @@ import ( "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/compression" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/compression" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/enclave/storage" ) /* diff --git a/go/enclave/components/rollup_consumer.go b/go/enclave/components/rollup_consumer.go index 204d833477..a6808d516b 100644 --- a/go/enclave/components/rollup_consumer.go +++ b/go/enclave/components/rollup_consumer.go @@ -3,17 +3,17 @@ package components import ( "fmt" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" - "github.com/obscuronet/go-obscuro/go/common/measure" + "github.com/ten-protocol/go-ten/go/common/measure" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" ) type rollupConsumerImpl struct { diff --git a/go/enclave/components/rollup_producer.go b/go/enclave/components/rollup_producer.go index 1b6a9a60cd..b83f605b11 100644 --- a/go/enclave/components/rollup_producer.go +++ b/go/enclave/components/rollup_producer.go @@ -6,17 +6,17 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/enclave/limiters" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/limiters" gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" ) type rollupProducerImpl struct { diff --git a/go/enclave/components/shared_secret_process.go b/go/enclave/components/shared_secret_process.go index 2830b02f2c..34f81a0372 100644 --- a/go/enclave/components/shared_secret_process.go +++ b/go/enclave/components/shared_secret_process.go @@ -5,12 +5,12 @@ import ( gethcrypto "github.com/ethereum/go-ethereum/crypto" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/go/enclave/storage" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" ) type SharedSecretProcessor struct { diff --git a/go/enclave/components/sigverifier.go b/go/enclave/components/sigverifier.go index 123e2ba329..9abf9b00e6 100644 --- a/go/enclave/components/sigverifier.go +++ b/go/enclave/components/sigverifier.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/enclave/container/cli.go b/go/enclave/container/cli.go index 88928bbe19..baf7cf0c6a 100644 --- a/go/enclave/container/cli.go +++ b/go/enclave/container/cli.go @@ -6,11 +6,11 @@ import ( "math/big" "os" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/naoina/toml" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" ) // EnclaveConfigToml is the structure that an enclave's .toml config is parsed into. diff --git a/go/enclave/container/cli_test.go b/go/enclave/container/cli_test.go index 60d7acd101..33d03f3b45 100644 --- a/go/enclave/container/cli_test.go +++ b/go/enclave/container/cli_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" ) const ( diff --git a/go/enclave/container/enclave_container.go b/go/enclave/container/enclave_container.go index 8302eaaa6c..010a1e152b 100644 --- a/go/enclave/container/enclave_container.go +++ b/go/enclave/container/enclave_container.go @@ -5,15 +5,15 @@ import ( "fmt" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" - obscuroGenesis "github.com/obscuronet/go-obscuro/go/enclave/genesis" + obscuroGenesis "github.com/ten-protocol/go-ten/go/enclave/genesis" ) // todo (#1056) - replace with the genesis.json of Obscuro's L1 network. diff --git a/go/enclave/core/batch.go b/go/enclave/core/batch.go index 67b4d3db77..bc97ff22e1 100644 --- a/go/enclave/core/batch.go +++ b/go/enclave/core/batch.go @@ -4,14 +4,14 @@ import ( "math/big" "sync/atomic" - "github.com/obscuronet/go-obscuro/go/common/compression" + "github.com/ten-protocol/go-ten/go/common/compression" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/enclave/crypto" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // Batch Data structure only for the internal use of the enclave since transactions are in clear diff --git a/go/enclave/core/rollup.go b/go/enclave/core/rollup.go index 65d75dbb32..49198854de 100644 --- a/go/enclave/core/rollup.go +++ b/go/enclave/core/rollup.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // Rollup - is an internal data structure useful during creation diff --git a/go/enclave/core/serialisation_test.go b/go/enclave/core/serialisation_test.go index fccbb68247..f51c641197 100644 --- a/go/enclave/core/serialisation_test.go +++ b/go/enclave/core/serialisation_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/integration/datagenerator" ) func TestSerialiseL2Tx(t *testing.T) { diff --git a/go/enclave/core/utils.go b/go/enclave/core/utils.go index 0bd8844fda..4addbea6b0 100644 --- a/go/enclave/core/utils.go +++ b/go/enclave/core/utils.go @@ -7,8 +7,8 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/measure" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/measure" ) // VerifySignature - Checks that the L2Tx has a valid signature. diff --git a/go/enclave/core/utils_test.go b/go/enclave/core/utils_test.go index acc947bde0..ea6d6081b3 100644 --- a/go/enclave/core/utils_test.go +++ b/go/enclave/core/utils_test.go @@ -4,7 +4,7 @@ import ( "math/big" "testing" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/datagenerator" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" diff --git a/go/enclave/crosschain/block_message_extractor.go b/go/enclave/crosschain/block_message_extractor.go index ad5d09df2d..8742c894c6 100644 --- a/go/enclave/crosschain/block_message_extractor.go +++ b/go/enclave/crosschain/block_message_extractor.go @@ -3,15 +3,15 @@ package crosschain import ( "fmt" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/measure" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/measure" ) type blockMessageExtractor struct { diff --git a/go/enclave/crosschain/common.go b/go/enclave/crosschain/common.go index fc0f0772ee..f9a91782e8 100644 --- a/go/enclave/crosschain/common.go +++ b/go/enclave/crosschain/common.go @@ -10,8 +10,8 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/go/common" "golang.org/x/crypto/sha3" ) diff --git a/go/enclave/crosschain/interfaces.go b/go/enclave/crosschain/interfaces.go index 3500448c3a..f382b35491 100644 --- a/go/enclave/crosschain/interfaces.go +++ b/go/enclave/crosschain/interfaces.go @@ -3,7 +3,7 @@ package crosschain import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) type ( diff --git a/go/enclave/crosschain/message_bus_manager.go b/go/enclave/crosschain/message_bus_manager.go index e0eddfbe89..1731a10515 100644 --- a/go/enclave/crosschain/message_bus_manager.go +++ b/go/enclave/crosschain/message_bus_manager.go @@ -5,18 +5,18 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/rpc" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/rpc" + "github.com/ten-protocol/go-ten/go/wallet" ) // todo (#1549) - implement with cryptography epic diff --git a/go/enclave/crosschain/processors.go b/go/enclave/crosschain/processors.go index 259a604f4b..3469d0070c 100644 --- a/go/enclave/crosschain/processors.go +++ b/go/enclave/crosschain/processors.go @@ -3,7 +3,7 @@ package crosschain import ( "math/big" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/go/enclave/crypto/README.md b/go/enclave/crypto/README.md index 42b69b8bdd..8adee3086b 100644 --- a/go/enclave/crypto/README.md +++ b/go/enclave/crypto/README.md @@ -1 +1 @@ -This package contains logic which implements the cryptographic requirements of Obscuro. \ No newline at end of file +This package contains logic which implements the cryptographic requirements of Ten. \ No newline at end of file diff --git a/go/enclave/crypto/crypto.go b/go/enclave/crypto/crypto.go index 117ce45540..ca1fb6a14d 100644 --- a/go/enclave/crypto/crypto.go +++ b/go/enclave/crypto/crypto.go @@ -12,12 +12,12 @@ import ( gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) const ( diff --git a/go/enclave/crypto/data_enc_service.go b/go/enclave/crypto/data_enc_service.go index 13f943991c..04d9c1dc37 100644 --- a/go/enclave/crypto/data_enc_service.go +++ b/go/enclave/crypto/data_enc_service.go @@ -8,7 +8,7 @@ import ( gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/enclave/debugger/tracers.go b/go/enclave/debugger/tracers.go index 0aa3a3fb6c..01acb11906 100644 --- a/go/enclave/debugger/tracers.go +++ b/go/enclave/debugger/tracers.go @@ -6,9 +6,9 @@ import ( "encoding/json" "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common/tracers" - "github.com/obscuronet/go-obscuro/go/enclave/l2chain" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/common/tracers" + "github.com/ten-protocol/go-ten/go/enclave/l2chain" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index 4ad8bd0d76..2cc0fedab8 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -10,26 +10,25 @@ import ( "sync" "time" - "github.com/obscuronet/go-obscuro/go/common/measure" + "github.com/ten-protocol/go-ten/go/common/compression" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/enclave/evm/ethchainadapter" + "github.com/ten-protocol/go-ten/go/enclave/gas" + "github.com/ten-protocol/go-ten/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/txpool" + "github.com/ten-protocol/go-ten/go/enclave/vkhandler" - "github.com/obscuronet/go-obscuro/go/enclave/gas" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/components" + "github.com/ten-protocol/go-ten/go/enclave/nodetype" - "github.com/obscuronet/go-obscuro/go/enclave/vkhandler" + "github.com/ten-protocol/go-ten/go/enclave/l2chain" + "github.com/ten-protocol/go-ten/go/responses" - "github.com/obscuronet/go-obscuro/go/common/compression" + "github.com/ten-protocol/go-ten/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/enclave/components" - "github.com/obscuronet/go-obscuro/go/enclave/nodetype" + "github.com/ten-protocol/go-ten/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/l2chain" - "github.com/obscuronet/go-obscuro/go/responses" - - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - - "github.com/obscuronet/go-obscuro/go/enclave/core" - - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common/hexutil" @@ -38,25 +37,24 @@ import ( "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/gethapi" - "github.com/obscuronet/go-obscuro/go/common/gethencoding" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/profiler" - "github.com/obscuronet/go-obscuro/go/common/stopcontrol" - "github.com/obscuronet/go-obscuro/go/common/syserr" - "github.com/obscuronet/go-obscuro/go/common/tracers" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/enclave/crosschain" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/go/enclave/debugger" - "github.com/obscuronet/go-obscuro/go/enclave/events" - - "github.com/obscuronet/go-obscuro/go/enclave/mempool" - "github.com/obscuronet/go-obscuro/go/enclave/rpc" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - - _ "github.com/obscuronet/go-obscuro/go/common/tracers/native" // make sure the tracers are loaded + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/gethapi" + "github.com/ten-protocol/go-ten/go/common/gethencoding" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/profiler" + "github.com/ten-protocol/go-ten/go/common/stopcontrol" + "github.com/ten-protocol/go-ten/go/common/syserr" + "github.com/ten-protocol/go-ten/go/common/tracers" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/enclave/crosschain" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/enclave/debugger" + "github.com/ten-protocol/go-ten/go/enclave/events" + + "github.com/ten-protocol/go-ten/go/enclave/rpc" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + + _ "github.com/ten-protocol/go-ten/go/common/tracers/native" // make sure the tracers are loaded gethcommon "github.com/ethereum/go-ethereum/common" gethcore "github.com/ethereum/go-ethereum/core" @@ -127,29 +125,9 @@ func NewEnclave( } } - zeroTimestamp := uint64(0) // Initialise the database - chainConfig := params.ChainConfig{ - ChainID: big.NewInt(config.ObscuroChainID), - HomesteadBlock: gethcommon.Big0, - DAOForkBlock: gethcommon.Big0, - EIP150Block: gethcommon.Big0, - EIP155Block: gethcommon.Big0, - EIP158Block: gethcommon.Big0, - ByzantiumBlock: gethcommon.Big0, - ConstantinopleBlock: gethcommon.Big0, - PetersburgBlock: gethcommon.Big0, - IstanbulBlock: gethcommon.Big0, - MuirGlacierBlock: gethcommon.Big0, - BerlinBlock: gethcommon.Big0, - LondonBlock: gethcommon.Big0, - - CancunTime: &zeroTimestamp, - ShanghaiTime: &zeroTimestamp, - PragueTime: &zeroTimestamp, - VerkleTime: &zeroTimestamp, - } - storage := storage.NewStorageFromConfig(config, &chainConfig, logger) + chainConfig := ethchainadapter.ChainParams(big.NewInt(config.ObscuroChainID)) + storage := storage.NewStorageFromConfig(config, chainConfig, logger) // Initialise the Ethereum "Blockchain" structure that will allow us to validate incoming blocks // todo (#1056) - valid block @@ -200,25 +178,29 @@ func NewEnclave( dataEncryptionService := crypto.NewDataEncryptionService(logger) dataCompressionService := compression.NewBrotliDataCompressionService() - memp := mempool.New(config.ObscuroChainID, logger) - crossChainProcessors := crosschain.New(&config.MessageBusAddress, storage, big.NewInt(config.ObscuroChainID), logger) subscriptionManager := events.NewSubscriptionManager(&rpcEncryptionManager, storage, logger) gasOracle := gas.NewGasOracle() blockProcessor := components.NewBlockProcessor(storage, crossChainProcessors, gasOracle, logger) - batchExecutor := components.NewBatchExecutor(storage, crossChainProcessors, genesis, gasOracle, &chainConfig, logger) + batchExecutor := components.NewBatchExecutor(storage, crossChainProcessors, genesis, gasOracle, chainConfig, logger) sigVerifier, err := components.NewSignatureValidator(config.SequencerID, storage) registry := components.NewBatchRegistry(storage, logger) rProducer := components.NewRollupProducer(config.SequencerID, storage, registry, logger) if err != nil { logger.Crit("Could not initialise the signature validator", log.ErrKey, err) } - rollupCompression := components.NewRollupCompression(registry, batchExecutor, dataEncryptionService, dataCompressionService, storage, &chainConfig, logger) + rollupCompression := components.NewRollupCompression(registry, batchExecutor, dataEncryptionService, dataCompressionService, storage, chainConfig, logger) rConsumer := components.NewRollupConsumer(mgmtContractLib, registry, rollupCompression, storage, logger, sigVerifier) sharedSecretProcessor := components.NewSharedSecretProcessor(mgmtContractLib, attestationProvider, storage, logger) + blockchain := ethchainadapter.NewEthChainAdapter(big.NewInt(config.ObscuroChainID), registry, storage, logger) + mempool, err := txpool.NewTxPool(blockchain, config.MinGasPrice) + if err != nil { + logger.Crit("unable to init eth tx pool", log.ErrKey, err) + } + var service nodetype.NodeType if config.NodeType == common.Sequencer { service = nodetype.NewSequencer( @@ -230,9 +212,9 @@ func NewEnclave( rollupCompression, logger, config.HostID, - &chainConfig, + chainConfig, enclaveKey, - memp, + mempool, storage, dataEncryptionService, dataCompressionService, @@ -243,14 +225,15 @@ func NewEnclave( BatchGasLimit: config.GasLimit, BaseFee: config.BaseFee, }, + blockchain, ) } else { - service = nodetype.NewValidator(blockProcessor, batchExecutor, registry, rConsumer, &chainConfig, config.SequencerID, storage, sigVerifier, logger) + service = nodetype.NewValidator(blockProcessor, batchExecutor, registry, rConsumer, chainConfig, config.SequencerID, storage, sigVerifier, logger) } chain := l2chain.NewChain( storage, - &chainConfig, + chainConfig, genesis, logger, registry, @@ -263,7 +246,7 @@ func NewEnclave( } // TODO ensure debug is allowed/disallowed - debug := debugger.New(chain, storage, &chainConfig) + debug := debugger.New(chain, storage, chainConfig) logger.Info("Enclave service created with following config", log.CfgKey, config.HostID) return &enclaveImpl{ diff --git a/go/enclave/enclave_test.go.tmp b/go/enclave/enclave_test.go.tmp index 521fe0b86d..dcb048a395 100644 --- a/go/enclave/enclave_test.go.tmp +++ b/go/enclave/enclave_test.go.tmp @@ -15,18 +15,18 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/trie" - "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/responses" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/responses" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/datagenerator" "github.com/stretchr/testify/assert" gethcommon "github.com/ethereum/go-ethereum/common" diff --git a/go/enclave/events/subscription_manager.go b/go/enclave/events/subscription_manager.go index a66c9bf35f..47625eb32d 100644 --- a/go/enclave/events/subscription_manager.go +++ b/go/enclave/events/subscription_manager.go @@ -6,16 +6,16 @@ import ( "math/big" "sync" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/enclave/rpc" - "github.com/obscuronet/go-obscuro/go/enclave/vkhandler" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/rpc" + "github.com/ten-protocol/go-ten/go/enclave/vkhandler" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/go/enclave/evm/README.md b/go/enclave/evm/README.md index 70a4ffb5d3..1c9fabe500 100644 --- a/go/enclave/evm/README.md +++ b/go/enclave/evm/README.md @@ -1,4 +1,4 @@ -Obscuro executes EVM compatible transactions on top of a database that implements the Go-Ethereum interfaces. +Ten executes EVM compatible transactions on top of a database that implements the Go-Ethereum interfaces. The entry point is the evm_facade. diff --git a/go/enclave/evm/chain_context.go b/go/enclave/evm/chain_context.go index 34447396de..1eae4dd92a 100644 --- a/go/enclave/evm/chain_context.go +++ b/go/enclave/evm/chain_context.go @@ -3,15 +3,15 @@ package evm import ( "errors" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/gethencoding" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/gethencoding" + "github.com/ten-protocol/go-ten/go/common/log" ) // ObscuroChainContext - basic implementation of the ChainContext needed for the EVM integration diff --git a/go/enclave/evm/ethchainadapter/eth_chainadapter.go b/go/enclave/evm/ethchainadapter/eth_chainadapter.go new file mode 100644 index 0000000000..436132e3f9 --- /dev/null +++ b/go/enclave/evm/ethchainadapter/eth_chainadapter.go @@ -0,0 +1,153 @@ +package ethchainadapter + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/txpool/legacypool" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" + "github.com/ten-protocol/go-ten/go/common/gethencoding" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/components" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/storage" + + gethcore "github.com/ethereum/go-ethereum/core" + gethtypes "github.com/ethereum/go-ethereum/core/types" + gethlog "github.com/ethereum/go-ethereum/log" +) + +// EthChainAdapter is an obscuro wrapper around the ethereum core.Blockchain object +type EthChainAdapter struct { + newHeadChan chan gethcore.ChainHeadEvent + batchRegistry components.BatchRegistry + storage storage.Storage + chainID *big.Int + logger gethlog.Logger +} + +// NewEthChainAdapter returns a new instance +func NewEthChainAdapter(chainID *big.Int, batchRegistry components.BatchRegistry, storage storage.Storage, logger gethlog.Logger) *EthChainAdapter { + return &EthChainAdapter{ + newHeadChan: make(chan gethcore.ChainHeadEvent), + batchRegistry: batchRegistry, + storage: storage, + chainID: chainID, + logger: logger, + } +} + +// Config retrieves the chain's fork configuration. +func (e *EthChainAdapter) Config() *params.ChainConfig { + return ChainParams(e.chainID) +} + +// CurrentBlock returns the current head of the chain. +func (e *EthChainAdapter) CurrentBlock() *gethtypes.Header { + currentBatchSeqNo := e.batchRegistry.HeadBatchSeq() + if currentBatchSeqNo == nil { + return nil + } + currentBatch, err := e.storage.FetchBatchBySeqNo(currentBatchSeqNo.Uint64()) + if err != nil { + e.logger.Warn("unable to retrieve batch seq no: %d", "currentBatchSeqNo", currentBatchSeqNo, log.ErrKey, err) + return nil + } + batch, err := gethencoding.CreateEthHeaderForBatch(currentBatch.Header, secret(e.storage)) + if err != nil { + e.logger.Warn("unable to convert batch to eth header ", "currentBatchSeqNo", currentBatchSeqNo, log.ErrKey, err) + return nil + } + return batch +} + +func (e *EthChainAdapter) SubscribeChainHeadEvent(ch chan<- gethcore.ChainHeadEvent) event.Subscription { + return event.NewSubscription(func(quit <-chan struct{}) error { + for { + select { + case head := <-e.newHeadChan: + select { + case ch <- head: + case <-quit: + return nil + } + case <-quit: + return nil + } + } + }) +} + +// GetBlock retrieves a specific block, used during pool resets. +func (e *EthChainAdapter) GetBlock(_ common.Hash, number uint64) *gethtypes.Block { + nbatch, err := e.storage.FetchBatchByHeight(number) + if err != nil { + e.logger.Warn("unable to get batch by height", "number", number, log.ErrKey, err) + return nil + } + + nfromBatch, err := gethencoding.CreateEthBlockFromBatch(nbatch) + if err != nil { + e.logger.Error("unable to convert batch to eth block", log.ErrKey, err) + return nil + } + + return nfromBatch +} + +// StateAt returns a state database for a given root hash (generally the head). +func (e *EthChainAdapter) StateAt(root common.Hash) (*state.StateDB, error) { + if root.Hex() == gethtypes.EmptyCodeHash.Hex() { + return nil, nil //nolint:nilnil + } + + currentBatchSeqNo := e.batchRegistry.HeadBatchSeq() + if currentBatchSeqNo == nil { + return nil, fmt.Errorf("not ready yet") + } + currentBatch, err := e.storage.FetchBatchBySeqNo(currentBatchSeqNo.Uint64()) + if err != nil { + e.logger.Warn("unable to get batch by height", "currentBatchSeqNo", currentBatchSeqNo, log.ErrKey, err) + return nil, nil //nolint:nilnil + } + + return e.storage.CreateStateDB(currentBatch.Hash()) +} + +func (e *EthChainAdapter) IngestNewBlock(batch *core.Batch) error { + convertedBlock, err := gethencoding.CreateEthBlockFromBatch(batch) + if err != nil { + return err + } + + go func() { + e.newHeadChan <- gethcore.ChainHeadEvent{Block: convertedBlock} + }() + + return nil +} + +func NewLegacyPoolConfig() legacypool.Config { + return legacypool.Config{ + Locals: nil, + NoLocals: false, + Journal: "", + Rejournal: 0, + PriceLimit: 0, + PriceBump: 0, + AccountSlots: 100, + GlobalSlots: 10000000, + AccountQueue: 100, + GlobalQueue: 10000000, + Lifetime: 0, + } +} + +func secret(storage storage.Storage) []byte { + // todo (#1053) - handle secret not being found. + secret, _ := storage.FetchSecret() + return secret[:] +} diff --git a/go/enclave/evm/ethchainadapter/eth_chainparams.go b/go/enclave/evm/ethchainadapter/eth_chainparams.go new file mode 100644 index 0000000000..7e591c0b53 --- /dev/null +++ b/go/enclave/evm/ethchainadapter/eth_chainparams.go @@ -0,0 +1,36 @@ +package ethchainadapter + +import ( + "math/big" + + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" +) + +// ChainParams defines the forks of the EVM machine +// obscuro should typically be on the last fork version +func ChainParams(obscuroChainID *big.Int) *params.ChainConfig { + zeroTimestamp := uint64(0) + + // Initialise the database + return ¶ms.ChainConfig{ + ChainID: obscuroChainID, + HomesteadBlock: gethcommon.Big0, + DAOForkBlock: gethcommon.Big0, + EIP150Block: gethcommon.Big0, + EIP155Block: gethcommon.Big0, + EIP158Block: gethcommon.Big0, + ByzantiumBlock: gethcommon.Big0, + ConstantinopleBlock: gethcommon.Big0, + PetersburgBlock: gethcommon.Big0, + IstanbulBlock: gethcommon.Big0, + MuirGlacierBlock: gethcommon.Big0, + BerlinBlock: gethcommon.Big0, + LondonBlock: gethcommon.Big0, + + CancunTime: &zeroTimestamp, + ShanghaiTime: &zeroTimestamp, + PragueTime: &zeroTimestamp, + VerkleTime: &zeroTimestamp, + } +} diff --git a/go/enclave/evm/evm_facade.go b/go/enclave/evm/evm_facade.go index cf0fc976f4..cb841a5311 100644 --- a/go/enclave/evm/evm_facade.go +++ b/go/enclave/evm/evm_facade.go @@ -12,14 +12,14 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/gethencoding" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/measure" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/gethencoding" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" gethcore "github.com/ethereum/go-ethereum/core" diff --git a/go/enclave/genesis/genesis.go b/go/enclave/genesis/genesis.go index c0f28eb388..79173c7391 100644 --- a/go/enclave/genesis/genesis.go +++ b/go/enclave/genesis/genesis.go @@ -5,11 +5,11 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // Account specifies the address that's prefunded and the amount it's funded with diff --git a/go/enclave/genesis/genesis_test.go b/go/enclave/genesis/genesis_test.go index 5b057091e5..00ac8da2a8 100644 --- a/go/enclave/genesis/genesis_test.go +++ b/go/enclave/genesis/genesis_test.go @@ -5,12 +5,12 @@ import ( "math/big" "testing" - "github.com/obscuronet/go-obscuro/go/enclave/storage" - "github.com/obscuronet/go-obscuro/go/enclave/storage/init/sqlite" + "github.com/ten-protocol/go-ten/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage/init/sqlite" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/datagenerator" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/go/enclave/l2chain/README.md b/go/enclave/l2chain/README.md index 8ed73fb75f..2ea92b5492 100644 --- a/go/enclave/l2chain/README.md +++ b/go/enclave/l2chain/README.md @@ -1,4 +1,4 @@ -This is where the bulk of the Obscuro specific logic is. +This is where the bulk of the Ten specific logic is. The entry point is the `L2Chain`. Ethereum Blocks and Rollups produced by peers are fed into this datastructure, and it decides which is the canonical chain, diff --git a/go/enclave/l2chain/interfaces.go b/go/enclave/l2chain/interfaces.go index 6a97ccb6de..58dfc2d98f 100644 --- a/go/enclave/l2chain/interfaces.go +++ b/go/enclave/l2chain/interfaces.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/vm" gethrpc "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common/gethapi" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/common/gethapi" + "github.com/ten-protocol/go-ten/go/enclave/core" ) // ObscuroChain - the interface that provides the data access layer to the obscuro l2. diff --git a/go/enclave/l2chain/l1_blockchain.go b/go/enclave/l2chain/l1_blockchain.go index 8199f7cfcd..a7c6da1659 100644 --- a/go/enclave/l2chain/l1_blockchain.go +++ b/go/enclave/l2chain/l1_blockchain.go @@ -17,7 +17,7 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/trie" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/go/enclave/l2chain/l2_chain.go b/go/enclave/l2chain/l2_chain.go index 004cf2e350..ac35554645 100644 --- a/go/enclave/l2chain/l2_chain.go +++ b/go/enclave/l2chain/l2_chain.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -16,14 +16,14 @@ import ( gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" gethrpc "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common/gethapi" - "github.com/obscuronet/go-obscuro/go/common/gethencoding" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/components" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/evm" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" "github.com/status-im/keycard-go/hexutils" + "github.com/ten-protocol/go-ten/go/common/gethapi" + "github.com/ten-protocol/go-ten/go/common/gethencoding" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/components" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/evm" + "github.com/ten-protocol/go-ten/go/enclave/genesis" ) type obscuroChain struct { diff --git a/go/enclave/limiters/interfaces.go b/go/enclave/limiters/interfaces.go index 5a93a2ff17..404a0caaf4 100644 --- a/go/enclave/limiters/interfaces.go +++ b/go/enclave/limiters/interfaces.go @@ -3,7 +3,7 @@ package limiters import ( "errors" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" "github.com/ethereum/go-ethereum/core/types" ) diff --git a/go/enclave/limiters/rolluplimiter.go b/go/enclave/limiters/rolluplimiter.go index 36cc10e4b5..d7661af318 100644 --- a/go/enclave/limiters/rolluplimiter.go +++ b/go/enclave/limiters/rolluplimiter.go @@ -3,7 +3,7 @@ package limiters import ( "fmt" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" "github.com/ethereum/go-ethereum/rlp" ) diff --git a/go/enclave/main/main.go b/go/enclave/main/main.go index a082fbe8a2..d03967a258 100644 --- a/go/enclave/main/main.go +++ b/go/enclave/main/main.go @@ -3,8 +3,8 @@ package main import ( "fmt" - "github.com/obscuronet/go-obscuro/go/common/container" - enclavecontainer "github.com/obscuronet/go-obscuro/go/enclave/container" + "github.com/ten-protocol/go-ten/go/common/container" + enclavecontainer "github.com/ten-protocol/go-ten/go/enclave/container" ) // Runs an Obscuro enclave as a standalone process. diff --git a/go/enclave/mempool/README.md b/go/enclave/mempool/README.md deleted file mode 100644 index d3d2bad7e9..0000000000 --- a/go/enclave/mempool/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This package implements a very primitve, in-memory mempool. - diff --git a/go/enclave/mempool/interface.go b/go/enclave/mempool/interface.go deleted file mode 100644 index c6858321b7..0000000000 --- a/go/enclave/mempool/interface.go +++ /dev/null @@ -1,20 +0,0 @@ -package mempool - -import ( - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/enclave/limiters" -) - -type Manager interface { - // FetchMempoolTxs returns all transactions in the mempool - FetchMempoolTxs() []*common.L2Tx - // AddMempoolTx adds a transaction to the mempool - AddMempoolTx(tx *common.L2Tx) error - // RemoveTxs removes transactions that are considered immune to re-orgs (i.e. over X batches deep). - RemoveTxs(transactions types.Transactions) error - - // CurrentTxs Returns the transactions that should be included in the current batch - CurrentTxs(stateDB *state.StateDB, limiter limiters.BatchSizeLimiter) ([]*common.L2Tx, error) -} diff --git a/go/enclave/mempool/manager.go b/go/enclave/mempool/manager.go deleted file mode 100644 index b70bffa32c..0000000000 --- a/go/enclave/mempool/manager.go +++ /dev/null @@ -1,118 +0,0 @@ -package mempool - -import ( - "errors" - "sort" - "sync" - - "github.com/obscuronet/go-obscuro/go/common/log" - - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/limiters" - - gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" -) - -// sortByNonce a very primitive way to implement mempool logic that -// adds transactions sorted by the nonce in the rollup -// which is what the EVM expects -type sortByNonce []*common.L2Tx - -func (c sortByNonce) Len() int { return len(c) } -func (c sortByNonce) Swap(i, j int) { c[i], c[j] = c[j], c[i] } -func (c sortByNonce) Less(i, j int) bool { return c[i].Nonce() < c[j].Nonce() } - -// todo - optimize this to use a different data structure that does not require a global lock. -type mempoolManager struct { - mpMutex sync.RWMutex // Controls access to `mempool` - obscuroChainID int64 - logger gethlog.Logger - mempool map[gethcommon.Hash]*common.L2Tx -} - -func New(chainID int64, logger gethlog.Logger) Manager { - return &mempoolManager{ - mempool: make(map[gethcommon.Hash]*common.L2Tx), - obscuroChainID: chainID, - mpMutex: sync.RWMutex{}, - logger: logger, - } -} - -func (db *mempoolManager) AddMempoolTx(tx *common.L2Tx) error { - // We do not care about the sender return value at this point, only that - // there is no error coming from validating the signature of said sender. - _, err := core.GetAuthenticatedSender(db.obscuroChainID, tx) - if err != nil { - return err - } - - db.mpMutex.Lock() - defer db.mpMutex.Unlock() - db.mempool[tx.Hash()] = tx - return nil -} - -func (db *mempoolManager) FetchMempoolTxs() []*common.L2Tx { - db.mpMutex.RLock() - defer db.mpMutex.RUnlock() - - mpCopy := make([]*common.L2Tx, len(db.mempool)) - i := 0 - for _, tx := range db.mempool { - mpCopy[i] = tx - i++ - } - return mpCopy -} - -func (db *mempoolManager) RemoveTxs(transactions types.Transactions) error { - db.mpMutex.Lock() - defer db.mpMutex.Unlock() - - for _, tx := range transactions { - delete(db.mempool, tx.Hash()) - } - - return nil -} - -// CurrentTxs - Calculate transactions to be included in the current batch -func (db *mempoolManager) CurrentTxs(stateDB *state.StateDB, limiter limiters.BatchSizeLimiter) ([]*common.L2Tx, error) { - txes := db.FetchMempoolTxs() - sort.Sort(sortByNonce(txes)) - - applicableTransactions := make(common.L2Transactions, 0) - nonceTracker := NewNonceTracker(stateDB) - - for _, tx := range txes { - sender, _ := core.GetAuthenticatedSender(db.obscuroChainID, tx) - if sender == nil { - continue - } - - if tx.Nonce() != nonceTracker.GetNonce(*sender) { - continue - } - - err := limiter.AcceptTransaction(tx) - if err != nil { - if errors.Is(err, limiters.ErrInsufficientSpace) { // Batch ran out of space - break - } - // Limiter encountered unexpected error - return nil, err - } - - applicableTransactions = append(applicableTransactions, tx) - nonceTracker.IncrementNonce(*sender) - db.logger.Debug("Including transaction in batch", log.TxKey, tx.Hash(), "nonce", tx.Nonce()) - } - - return applicableTransactions, nil -} diff --git a/go/enclave/mempool/nonce_tracker.go b/go/enclave/mempool/nonce_tracker.go deleted file mode 100644 index 999a43dd08..0000000000 --- a/go/enclave/mempool/nonce_tracker.go +++ /dev/null @@ -1,40 +0,0 @@ -package mempool - -import ( - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" -) - -// NonceTracker - a struct that helps us maintain the nonces for each account. -// If it gets asked for an account it does not know the nonce for, it will pull it -// from stateDB. Used when selecting transactions in order to ensure transactions get -// applied at correct nonces and correct order without any gaps. -type NonceTracker struct { - accountNonces map[gethcommon.Address]uint64 - stateDB *state.StateDB -} - -func NewNonceTracker(stateDB *state.StateDB) *NonceTracker { - return &NonceTracker{ - stateDB: stateDB, - accountNonces: make(map[gethcommon.Address]uint64), - } -} - -func (nt *NonceTracker) GetNonce(address gethcommon.Address) uint64 { - if nonce, ok := nt.accountNonces[address]; ok { - return nonce - } - - nonce := nt.nonceFromState(address) - nt.accountNonces[address] = nonce - return nonce -} - -func (nt *NonceTracker) nonceFromState(address gethcommon.Address) uint64 { - return nt.stateDB.GetNonce(address) -} - -func (nt *NonceTracker) IncrementNonce(address gethcommon.Address) { - nt.accountNonces[address]++ -} diff --git a/go/enclave/nodetype/interfaces.go b/go/enclave/nodetype/interfaces.go index 3eb3e78c37..d4befbf498 100644 --- a/go/enclave/nodetype/interfaces.go +++ b/go/enclave/nodetype/interfaces.go @@ -2,9 +2,9 @@ package nodetype import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/enclave/components" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/components" + "github.com/ten-protocol/go-ten/go/enclave/core" ) // NodeType - the interface for any service type running in Obscuro nodes. diff --git a/go/enclave/nodetype/sequencer.go b/go/enclave/nodetype/sequencer.go index 56f11c0963..c8dd9dc6a0 100644 --- a/go/enclave/nodetype/sequencer.go +++ b/go/enclave/nodetype/sequencer.go @@ -9,25 +9,24 @@ import ( "sort" "time" - "github.com/obscuronet/go-obscuro/go/common/measure" - - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/enclave/evm/ethchainadapter" + "github.com/ten-protocol/go-ten/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/txpool" - "github.com/obscuronet/go-obscuro/go/common/compression" + "github.com/ten-protocol/go-ten/go/common/compression" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/components" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/go/enclave/limiters" - "github.com/obscuronet/go-obscuro/go/enclave/mempool" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/components" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/enclave/limiters" ) const RollupDelay = 2 // number of L1 blocks to exclude when creating a rollup. This will minimize compression reorg issues. @@ -53,11 +52,12 @@ type sequencer struct { hostID gethcommon.Address chainConfig *params.ChainConfig enclavePrivateKey *ecdsa.PrivateKey // this is a key known only to the current enclave, and the public key was shared with everyone during attestation - mempool mempool.Manager + mempool *txpool.TxPool storage storage.Storage dataEncryptionService crypto.DataEncryptionService dataCompressionService compression.DataCompressionService settings SequencerSettings + blockchain *ethchainadapter.EthChainAdapter } func NewSequencer( @@ -67,17 +67,16 @@ func NewSequencer( rollupProducer components.RollupProducer, rollupConsumer components.RollupConsumer, rollupCompression *components.RollupCompression, - logger gethlog.Logger, - hostID gethcommon.Address, chainConfig *params.ChainConfig, - enclavePrivateKey *ecdsa.PrivateKey, // this is a key known only to the current enclave, and the public key was shared with everyone during attestation - mempool mempool.Manager, + enclavePrivateKey *ecdsa.PrivateKey, + mempool *txpool.TxPool, storage storage.Storage, dataEncryptionService crypto.DataEncryptionService, dataCompressionService compression.DataCompressionService, settings SequencerSettings, + blockchain *ethchainadapter.EthChainAdapter, ) Sequencer { return &sequencer{ blockProcessor: blockProcessor, @@ -95,6 +94,7 @@ func NewSequencer( dataEncryptionService: dataEncryptionService, dataCompressionService: dataCompressionService, settings: settings, + blockchain: blockchain, } } @@ -110,8 +110,18 @@ func (s *sequencer) CreateBatch(skipBatchIfEmpty bool) error { return fmt.Errorf("failed retrieving l1 head. Cause: %w", err) } + // the sequencer creates the initial genesis batch if one does not exist yet if !hasGenesis { - return s.initGenesis(l1HeadBlock) + return s.createGenesisBatch(l1HeadBlock) + } + + if running := s.mempool.Running(); !running { + // the mempool can only be started after at least 1 block (the genesis) is in the blockchain object + // if the node restarted the mempool must be started again + err = s.mempool.Start() + if err != nil { + return err + } } return s.createNewHeadBatch(l1HeadBlock, skipBatchIfEmpty) @@ -121,7 +131,7 @@ func (s *sequencer) CreateBatch(skipBatchIfEmpty bool) error { // should only create batches and stateDBs but not commit them to the database, // this is the responsibility of the sequencer. Refactor the code so genesis state // won't be committed by the producer. -func (s *sequencer) initGenesis(block *common.L1Block) error { +func (s *sequencer) createGenesisBatch(block *common.L1Block) error { s.logger.Info("Initializing genesis state", log.BlockHashKey, block.Hash()) batch, msgBusTx, err := s.batchProducer.CreateGenesisState( block.Hash(), @@ -134,10 +144,6 @@ func (s *sequencer) initGenesis(block *common.L1Block) error { return err } - if err = s.mempool.AddMempoolTx(msgBusTx); err != nil { - return fmt.Errorf("failed to queue message bus creation transaction to genesis. Cause: %w", err) - } - if err := s.signBatch(batch); err != nil { return fmt.Errorf("failed signing created batch. Cause: %w", err) } @@ -146,6 +152,45 @@ func (s *sequencer) initGenesis(block *common.L1Block) error { return fmt.Errorf("1. failed storing batch. Cause: %w", err) } + // this is the actual first block produced in chain + err = s.blockchain.IngestNewBlock(batch) + if err != nil { + return fmt.Errorf("unable to remove ingest new block into eth blockchain - %w", err) + } + + // the mempool can only be started after at least 1 block is in the blockchain object + err = s.mempool.Start() + if err != nil { + return err + } + + // produce batch #2 which has the message bus and any other system contracts + cb, err := s.produceBatch( + batch.Header.SequencerOrderNo.Add(batch.Header.SequencerOrderNo, big.NewInt(1)), + block.Hash(), + batch.Hash(), + common.L2Transactions{msgBusTx}, + uint64(time.Now().Unix()), + false, + ) + if err != nil { + if errors.Is(err, components.ErrNoTransactionsToProcess) { + // skip batch production when there are no transactions to process + // todo: this might be a useful event to track for metrics (skipping batch production because empty batch) + s.logger.Debug("Skipping batch production, no transactions to execute") + return nil + } + return fmt.Errorf(" failed producing batch. Cause: %w", err) + } + + if len(cb.Receipts) == 0 || cb.Receipts[0].TxHash.Hex() != msgBusTx.Hash().Hex() { + err = fmt.Errorf("message Bus contract not minted - no receipts in batch") + s.logger.Error(err.Error()) + return err + } + + s.logger.Info("Message Bus Contract minted successfully", "address", cb.Receipts[0].ContractAddress.Hex()) + return nil } @@ -168,16 +213,25 @@ func (s *sequencer) createNewHeadBatch(l1HeadBlock *common.L1Block, skipBatchIfE return fmt.Errorf("attempted to create batch on top of batch=%s. With l1 head=%s", headBatch.Hash(), l1HeadBlock.Hash()) } - stateDB, err := s.storage.CreateStateDB(headBatch.Hash()) - if err != nil { - return fmt.Errorf("unable to create stateDB for selecting transactions. Batch: %s Cause: %w", headBatch.Hash(), err) - } - // todo (@stefan) - limit on receipts too limiter := limiters.NewBatchSizeLimiter(s.settings.MaxBatchSize) - transactions, err := s.mempool.CurrentTxs(stateDB, limiter) - if err != nil { - return err + pendingTransactions := s.mempool.PendingTransactions() + var transactions []*types.Transaction + for _, group := range pendingTransactions { + // lazily resolve transactions until the batch runs out of space + for _, lazyTx := range group { + if tx := lazyTx.Resolve(); tx != nil { + err = limiter.AcceptTransaction(tx.Tx) + if err != nil { + if errors.Is(err, limiters.ErrInsufficientSpace) { // Batch ran out of space + break + } + // Limiter encountered unexpected error + return fmt.Errorf("limiter encountered unexpected error - %w", err) + } + transactions = append(transactions, tx.Tx) + } + } } sequencerNo, err := s.storage.FetchCurrentSequencerNo() @@ -196,14 +250,17 @@ func (s *sequencer) createNewHeadBatch(l1HeadBlock *common.L1Block, skipBatchIfE return fmt.Errorf(" failed producing batch. Cause: %w", err) } - if err := s.mempool.RemoveTxs(transactions); err != nil { - return fmt.Errorf("could not remove transactions from mempool. Cause: %w", err) - } - return nil } -func (s *sequencer) produceBatch(sequencerNo *big.Int, l1Hash common.L1BlockHash, headBatch common.L2BatchHash, transactions common.L2Transactions, batchTime uint64, failForEmptyBatch bool) (*core.Batch, error) { +func (s *sequencer) produceBatch( + sequencerNo *big.Int, + l1Hash common.L1BlockHash, + headBatch common.L2BatchHash, + transactions common.L2Transactions, + batchTime uint64, + failForEmptyBatch bool, +) (*components.ComputedBatch, error) { cb, err := s.batchProducer.ComputeBatch(&components.BatchExecutionContext{ BlockPtr: l1Hash, ParentPtr: headBatch, @@ -233,7 +290,13 @@ func (s *sequencer) produceBatch(sequencerNo *big.Int, l1Hash common.L1BlockHash s.logger.Info("Produced new batch", log.BatchHashKey, cb.Batch.Hash(), "height", cb.Batch.Number(), "numTxs", len(cb.Batch.Transactions), log.BatchSeqNoKey, cb.Batch.SeqNo(), "parent", cb.Batch.Header.ParentHash) - return cb.Batch, nil + // add the batch to the chain so it can remove pending transactions from the pool + err = s.blockchain.IngestNewBlock(cb.Batch) + if err != nil { + return nil, fmt.Errorf("unable to remove tx from mempool - %w", err) + } + + return cb, nil } // StoreExecutedBatch - stores an executed batch in one go. This can be done for the sequencer because it is guaranteed @@ -324,11 +387,11 @@ func (s *sequencer) duplicateBatches(l1Head *types.Block, nonCanonicalL1Path []c } sequencerNo = sequencerNo.Add(sequencerNo, big.NewInt(1)) // create the duplicate and store/broadcast it, recreate batch even if it was empty - b, err := s.produceBatch(sequencerNo, l1Head.ParentHash(), currentHead, orphanBatch.Transactions, orphanBatch.Header.Time, false) + cb, err := s.produceBatch(sequencerNo, l1Head.ParentHash(), currentHead, orphanBatch.Transactions, orphanBatch.Header.Time, false) if err != nil { return fmt.Errorf("could not produce batch. Cause %w", err) } - currentHead = b.Hash() + currentHead = cb.Batch.Hash() s.logger.Info("Duplicated batch", log.BatchHashKey, currentHead) } @@ -336,7 +399,7 @@ func (s *sequencer) duplicateBatches(l1Head *types.Block, nonCanonicalL1Path []c } func (s *sequencer) SubmitTransaction(transaction *common.L2Tx) error { - return s.mempool.AddMempoolTx(transaction) + return s.mempool.Add(transaction) } func (s *sequencer) OnL1Fork(fork *common.ChainFork) error { diff --git a/go/enclave/nodetype/validator.go b/go/enclave/nodetype/validator.go index 228db899d7..28663e7d72 100644 --- a/go/enclave/nodetype/validator.go +++ b/go/enclave/nodetype/validator.go @@ -7,16 +7,16 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/enclave/components" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/components" + "github.com/ten-protocol/go-ten/go/enclave/core" ) type obsValidator struct { diff --git a/go/enclave/rpc/README.md b/go/enclave/rpc/README.md index 9f70723331..1b970bc7f6 100644 --- a/go/enclave/rpc/README.md +++ b/go/enclave/rpc/README.md @@ -1,2 +1,2 @@ -All communication to and from Obscuro is encrypted. -This package handles the encryption logic between end users communicating via RPC with the Obscuro enclave. \ No newline at end of file +All communication to and from Ten is encrypted. +This package handles the encryption logic between end users communicating via RPC with the Ten enclave. \ No newline at end of file diff --git a/go/enclave/rpc/rpc_utils.go b/go/enclave/rpc/rpc_utils.go index d2e6c5d3f7..9414678a8e 100644 --- a/go/enclave/rpc/rpc_utils.go +++ b/go/enclave/rpc/rpc_utils.go @@ -5,7 +5,7 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // ExtractTx returns the common.L2Tx from the params of an eth_sendRawTransaction request. diff --git a/go/enclave/rpc_server.go b/go/enclave/rpc_server.go index 255b0d5a67..5777e9ab27 100644 --- a/go/enclave/rpc_server.go +++ b/go/enclave/rpc_server.go @@ -10,12 +10,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/rpc" - "github.com/obscuronet/go-obscuro/go/common/rpc/generated" - "github.com/obscuronet/go-obscuro/go/common/tracers" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/rpc" + "github.com/ten-protocol/go-ten/go/common/rpc/generated" + "github.com/ten-protocol/go-ten/go/common/tracers" "google.golang.org/grpc" gethcommon "github.com/ethereum/go-ethereum/common" diff --git a/go/enclave/storage/README.md b/go/enclave/storage/README.md index 69adf2f315..389586d5d1 100644 --- a/go/enclave/storage/README.md +++ b/go/enclave/storage/README.md @@ -1,4 +1,4 @@ -This package implements the storage requirements of Obscuro. +This package implements the storage requirements of Ten. - The services it exposes are available in "interfaces.go". - The storage is created using: ``NewStorageFromConfig`` \ No newline at end of file diff --git a/go/enclave/storage/db_cache.go b/go/enclave/storage/db_cache.go index d9f5dfa5cc..555e2b060e 100644 --- a/go/enclave/storage/db_cache.go +++ b/go/enclave/storage/db_cache.go @@ -6,7 +6,7 @@ import ( "github.com/eko/gocache/lib/v4/cache" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" ) func getCachedValue[V any](cache *cache.Cache[[]byte], logger gethlog.Logger, key any, onFailed func(any) (V, error)) (V, error) { diff --git a/go/enclave/storage/db_init.go b/go/enclave/storage/db_init.go index 3d5b839bc4..bde5f2e063 100644 --- a/go/enclave/storage/db_init.go +++ b/go/enclave/storage/db_init.go @@ -3,14 +3,14 @@ package storage import ( "fmt" - "github.com/obscuronet/go-obscuro/go/enclave/storage/enclavedb" + "github.com/ten-protocol/go-ten/go/enclave/storage/enclavedb" - "github.com/obscuronet/go-obscuro/go/enclave/storage/init/edgelessdb" - "github.com/obscuronet/go-obscuro/go/enclave/storage/init/sqlite" + "github.com/ten-protocol/go-ten/go/enclave/storage/init/edgelessdb" + "github.com/ten-protocol/go-ten/go/enclave/storage/init/sqlite" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" ) // CreateDBFromConfig creates an appropriate ethdb.Database instance based on your config diff --git a/go/enclave/storage/enclavedb/README.md b/go/enclave/storage/enclavedb/README.md index 5254e2ae42..f243e7a8e7 100644 --- a/go/enclave/storage/enclavedb/README.md +++ b/go/enclave/storage/enclavedb/README.md @@ -5,8 +5,8 @@ Currently, it is at the first version which is a little rough. ### Historical reasoning for the current design: 1. Geth is implemented on top of levelDB, and so makes heavy use of the k/v mechanism. -2. Obscuro uses EdglessDb in production, and sqlite in testing. -3. Obscuro started out by implementing the k/v primitives on top of sql. +2. Ten uses EdglessDb in production, and sqlite in testing. +3. Ten started out by implementing the k/v primitives on top of sql. 4. Then we decided to use the SQL features to simplify some business logic, which required exposing the sql primitives. 5. Eventually, we ended up using SQL for everything, except the evm functionality. diff --git a/go/enclave/storage/enclavedb/batch.go b/go/enclave/storage/enclavedb/batch.go index 8072e68947..39e10337b8 100644 --- a/go/enclave/storage/enclavedb/batch.go +++ b/go/enclave/storage/enclavedb/batch.go @@ -15,9 +15,9 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/enclave/core" ) const ( diff --git a/go/enclave/storage/enclavedb/block.go b/go/enclave/storage/enclavedb/block.go index 8839e51159..21d1953afe 100644 --- a/go/enclave/storage/enclavedb/block.go +++ b/go/enclave/storage/enclavedb/block.go @@ -10,8 +10,8 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" ) const ( diff --git a/go/enclave/storage/enclavedb/config.go b/go/enclave/storage/enclavedb/config.go index 99b455f98f..615cdaf0fa 100644 --- a/go/enclave/storage/enclavedb/config.go +++ b/go/enclave/storage/enclavedb/config.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" ) const ( diff --git a/go/enclave/storage/enclavedb/enclave_sql_db_test.go b/go/enclave/storage/enclavedb/enclave_sql_db_test.go index 430b7f5288..750386b9e5 100644 --- a/go/enclave/storage/enclavedb/enclave_sql_db_test.go +++ b/go/enclave/storage/enclavedb/enclave_sql_db_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" "github.com/status-im/keycard-go/hexutils" diff --git a/go/enclave/storage/enclavedb/events.go b/go/enclave/storage/enclavedb/events.go index 5483f4bb64..aa0ccefaf2 100644 --- a/go/enclave/storage/enclavedb/events.go +++ b/go/enclave/storage/enclavedb/events.go @@ -9,8 +9,8 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/tracers" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/tracers" ) const ( diff --git a/go/enclave/storage/enclavedb/keyvalue.go b/go/enclave/storage/enclavedb/keyvalue.go index 238ace7e77..568f16cb03 100644 --- a/go/enclave/storage/enclavedb/keyvalue.go +++ b/go/enclave/storage/enclavedb/keyvalue.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/ethdb" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" ) const ( diff --git a/go/enclave/storage/init/edgelessdb/edgelessdb.go b/go/enclave/storage/init/edgelessdb/edgelessdb.go index 6bd5eb3028..dc20537b65 100644 --- a/go/enclave/storage/init/edgelessdb/edgelessdb.go +++ b/go/enclave/storage/init/edgelessdb/edgelessdb.go @@ -24,16 +24,16 @@ import ( "strings" "time" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/storage/init/migration" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/storage/init/migration" - "github.com/obscuronet/go-obscuro/go/enclave/storage/enclavedb" + "github.com/ten-protocol/go-ten/go/enclave/storage/enclavedb" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/httputil" + "github.com/ten-protocol/go-ten/go/common/httputil" - "github.com/obscuronet/go-obscuro/go/enclave/core/egoutils" + "github.com/ten-protocol/go-ten/go/enclave/core/egoutils" "github.com/go-sql-driver/mysql" ) diff --git a/go/enclave/storage/init/migration/db_migration.go b/go/enclave/storage/init/migration/db_migration.go index b243bc0125..be56fe9433 100644 --- a/go/enclave/storage/init/migration/db_migration.go +++ b/go/enclave/storage/init/migration/db_migration.go @@ -12,8 +12,8 @@ import ( "strings" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/enclave/storage/enclavedb" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/enclave/storage/enclavedb" ) const currentMigrationVersionKey = "CURRENT_MIGRATION_VERSION" diff --git a/go/enclave/storage/init/sqlite/sqlite.go b/go/enclave/storage/init/sqlite/sqlite.go index b74fa82acf..94c2851b5b 100644 --- a/go/enclave/storage/init/sqlite/sqlite.go +++ b/go/enclave/storage/init/sqlite/sqlite.go @@ -8,14 +8,14 @@ import ( "path/filepath" "strings" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/storage/init/migration" + "github.com/ten-protocol/go-ten/go/enclave/storage/init/migration" - "github.com/obscuronet/go-obscuro/go/enclave/storage/enclavedb" + "github.com/ten-protocol/go-ten/go/enclave/storage/enclavedb" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" _ "github.com/mattn/go-sqlite3" // this imports the sqlite driver to make the sql.Open() connection work ) diff --git a/go/enclave/storage/interfaces.go b/go/enclave/storage/interfaces.go index 5b5e2b7ff9..9b84a3d4c4 100644 --- a/go/enclave/storage/interfaces.go +++ b/go/enclave/storage/interfaces.go @@ -11,10 +11,10 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/tracers" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/tracers" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" ) // BlockResolver stores new blocks and returns information on existing blocks diff --git a/go/enclave/storage/storage.go b/go/enclave/storage/storage.go index 5d3e336e99..c54c900abd 100644 --- a/go/enclave/storage/storage.go +++ b/go/enclave/storage/storage.go @@ -9,15 +9,15 @@ import ( "math/big" "time" - "github.com/obscuronet/go-obscuro/go/common/measure" + "github.com/ten-protocol/go-ten/go/common/measure" "github.com/allegro/bigcache/v3" "github.com/eko/gocache/lib/v4/cache" bigcache_store "github.com/eko/gocache/store/bigcache/v4" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" - "github.com/obscuronet/go-obscuro/go/enclave/storage/enclavedb" + "github.com/ten-protocol/go-ten/go/enclave/storage/enclavedb" "github.com/ethereum/go-ethereum/rlp" @@ -25,16 +25,16 @@ import ( gethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/trie" - "github.com/obscuronet/go-obscuro/go/common/syserr" + "github.com/ten-protocol/go-ten/go/common/syserr" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/tracers" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/tracers" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/go/enclave/txpool/txpool.go b/go/enclave/txpool/txpool.go new file mode 100644 index 0000000000..22cb7b245b --- /dev/null +++ b/go/enclave/txpool/txpool.go @@ -0,0 +1,77 @@ +package txpool + +import ( + "fmt" + "math/big" + "strings" + + gethcommon "github.com/ethereum/go-ethereum/common" + gethtxpool "github.com/ethereum/go-ethereum/core/txpool" + "github.com/ethereum/go-ethereum/core/txpool/legacypool" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/evm/ethchainadapter" +) + +// TxPool is an obscuro wrapper around geths transaction pool +type TxPool struct { + txPoolConfig legacypool.Config + legacyPool *legacypool.LegacyPool + pool *gethtxpool.TxPool + blockchain *ethchainadapter.EthChainAdapter + gasTip *big.Int + running bool +} + +// NewTxPool returns a new instance of the tx pool +func NewTxPool(blockchain *ethchainadapter.EthChainAdapter, gasTip *big.Int) (*TxPool, error) { + txPoolConfig := ethchainadapter.NewLegacyPoolConfig() + legacyPool := legacypool.New(txPoolConfig, blockchain) + + return &TxPool{ + blockchain: blockchain, + txPoolConfig: txPoolConfig, + legacyPool: legacyPool, + gasTip: gasTip, + }, nil +} + +// Start starts the pool +// can only be started after t.blockchain has at least one block inside +func (t *TxPool) Start() error { + if t.pool != nil { + return fmt.Errorf("tx pool already started") + } + + memp, err := gethtxpool.New(t.gasTip, t.blockchain, []gethtxpool.SubPool{t.legacyPool}) + if err != nil { + return fmt.Errorf("unable to init geth tx pool - %w", err) + } + + t.pool = memp + t.running = true + return nil +} + +// PendingTransactions returns all pending transactions grouped per address and ordered per nonce +func (t *TxPool) PendingTransactions() map[gethcommon.Address][]*gethtxpool.LazyTransaction { + return t.pool.Pending(false) +} + +// Add adds a new transactions to the pool +func (t *TxPool) Add(transaction *common.L2Tx) error { + var strErrors []string + for _, err := range t.pool.Add([]*gethtxpool.Transaction{{Tx: transaction}}, false, false) { + if err != nil { + strErrors = append(strErrors, err.Error()) + } + } + + if len(strErrors) > 0 { + return fmt.Errorf(strings.Join(strErrors, "; ")) + } + return nil +} + +func (t *TxPool) Running() bool { + return t.running +} diff --git a/go/enclave/txpool/txpool_mock_test.go b/go/enclave/txpool/txpool_mock_test.go new file mode 100644 index 0000000000..61df88d78c --- /dev/null +++ b/go/enclave/txpool/txpool_mock_test.go @@ -0,0 +1,342 @@ +package txpool + +import ( + "crypto/ecdsa" + "math/big" + + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/trie" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/tracers" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/enclave/limiters" + + gethcommon "github.com/ethereum/go-ethereum/common" +) + +type mockBatchRegistry struct { + currentBatch *core.Batch +} + +func (m *mockBatchRegistry) BatchesAfter(_ uint64, _ uint64, _ limiters.RollupLimiter) ([]*core.Batch, []*types.Block, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockBatchRegistry) GetBatchStateAtHeight(_ *rpc.BlockNumber) (*state.StateDB, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockBatchRegistry) GetBatchAtHeight(_ rpc.BlockNumber) (*core.Batch, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockBatchRegistry) SubscribeForExecutedBatches(_ func(*core.Batch, types.Receipts)) { + // TODO implement me + panic("implement me") +} + +func (m *mockBatchRegistry) UnsubscribeFromBatches() { + // TODO implement me + panic("implement me") +} + +func (m *mockBatchRegistry) OnBatchExecuted(batch *core.Batch, _ types.Receipts) { + m.currentBatch = batch +} + +func (m *mockBatchRegistry) HasGenesisBatch() (bool, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockBatchRegistry) HeadBatchSeq() *big.Int { + return m.currentBatch.SeqNo() +} + +func newMockBatchRegistry() *mockBatchRegistry { + return &mockBatchRegistry{} +} + +type mockStorage struct { + currentBatch *core.Batch + batchesSeqNo map[uint64]*core.Batch + batchesHeight map[uint64]*core.Batch + batchesHash map[gethcommon.Hash]*core.Batch + stateDB state.Database +} + +func newMockStorage() *mockStorage { + db := state.NewDatabaseWithConfig(rawdb.NewMemoryDatabase(), &trie.Config{ + Cache: 1_000_000, + }) + stateDB, err := state.New(types.EmptyRootHash, db, nil) + if err != nil { + panic(err) + } + + _, err = stateDB.Commit(0, true) + if err != nil { + panic(err) + } + + return &mockStorage{ + batchesSeqNo: map[uint64]*core.Batch{}, + batchesHeight: map[uint64]*core.Batch{}, + batchesHash: map[gethcommon.Hash]*core.Batch{}, + stateDB: db, + } +} + +func (m *mockStorage) FetchBlock(_ common.L1BlockHash) (*types.Block, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchCanonicaBlockByHeight(_ *big.Int) (*types.Block, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchHeadBlock() (*types.Block, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) StoreBlock(_ *types.Block, _ *common.ChainFork) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) IsAncestor(_ *types.Block, _ *types.Block) bool { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) IsBlockAncestor(_ *types.Block, _ common.L1BlockHash) bool { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchBatch(_ common.L2BatchHash) (*core.Batch, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchBatchHeader(_ common.L2BatchHash) (*common.BatchHeader, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchBatchByHeight(height uint64) (*core.Batch, error) { + batch, found := m.batchesHeight[height] + if !found { + return nil, errutil.ErrNotFound + } + return batch, nil +} + +func (m *mockStorage) FetchBatchBySeqNo(seqNum uint64) (*core.Batch, error) { + batch, found := m.batchesSeqNo[seqNum] + if !found { + return nil, errutil.ErrNotFound + } + return batch, nil +} + +func (m *mockStorage) FetchHeadBatch() (*core.Batch, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchCurrentSequencerNo() (*big.Int, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchBatchesByBlock(_ common.L1BlockHash) ([]*core.Batch, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchNonCanonicalBatchesBetween(_ uint64, _ uint64) ([]*core.Batch, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchCanonicalUnexecutedBatches(_ *big.Int) ([]*core.Batch, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) BatchWasExecuted(_ common.L2BatchHash) (bool, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchHeadBatchForBlock(_ common.L1BlockHash) (*core.Batch, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) StoreBatch(_ *core.Batch) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) StoreExecutedBatch(batch *core.Batch, _ []*types.Receipt) error { + m.currentBatch = batch + m.batchesSeqNo[batch.SeqNo().Uint64()] = batch + m.batchesHeight[batch.Number().Uint64()] = batch + m.batchesHash[batch.Hash()] = batch + return nil +} + +func (m *mockStorage) StoreRollup(_ *common.ExtRollup, _ *common.CalldataRollupHeader) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchReorgedRollup(_ []common.L1BlockHash) (*common.L2BatchHash, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) CreateStateDB(hash common.L2BatchHash) (*state.StateDB, error) { + batch, found := m.batchesHash[hash] + if !found { + return nil, errutil.ErrNotFound + } + return state.New(batch.Header.Root, m.stateDB, nil) +} + +func (m *mockStorage) EmptyStateDB() (*state.StateDB, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchSecret() (*crypto.SharedEnclaveSecret, error) { + return &crypto.SharedEnclaveSecret{}, nil +} + +func (m *mockStorage) StoreSecret(_ crypto.SharedEnclaveSecret) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetTransaction(_ common.L2TxHash) (*types.Transaction, gethcommon.Hash, uint64, uint64, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetTransactionReceipt(_ common.L2TxHash) (*types.Receipt, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetReceiptsByBatchHash(_ common.L2BatchHash) (types.Receipts, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetContractCreationTx(_ gethcommon.Address) (*gethcommon.Hash, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FetchAttestedKey(_ gethcommon.Address) (*ecdsa.PublicKey, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) StoreAttestedKey(_ gethcommon.Address, _ *ecdsa.PublicKey) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) StoreL1Messages(_ common.L1BlockHash, _ common.CrossChainMessages) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetL1Messages(_ common.L1BlockHash) (common.CrossChainMessages, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) StoreValueTransfers(_ common.L1BlockHash, _ common.ValueTransferEvents) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetL1Transfers(_ common.L1BlockHash) (common.ValueTransferEvents, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) StoreEnclaveKey(_ *ecdsa.PrivateKey) error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetEnclaveKey() (*ecdsa.PrivateKey, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetContractCount() (*big.Int, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetReceiptsPerAddress(_ *gethcommon.Address, _ *common.QueryPagination) (types.Receipts, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetPublicTransactionData(_ *common.QueryPagination) ([]common.PublicTransaction, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetPublicTransactionCount() (uint64, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) GetReceiptsPerAddressCount(_ *gethcommon.Address) (uint64, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) Close() error { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) HealthCheck() (bool, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) FilterLogs(_ *gethcommon.Address, _, _ *big.Int, _ *common.L2BatchHash, _ []gethcommon.Address, _ [][]gethcommon.Hash) ([]*types.Log, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) DebugGetLogs(_ common.TxHash) ([]*tracers.DebugLogs, error) { + // TODO implement me + panic("implement me") +} + +func (m *mockStorage) TrieDB() *trie.Database { + // TODO implement me + panic("implement me") +} diff --git a/go/enclave/txpool/txpool_test.go b/go/enclave/txpool/txpool_test.go new file mode 100644 index 0000000000..9fb586d836 --- /dev/null +++ b/go/enclave/txpool/txpool_test.go @@ -0,0 +1,111 @@ +package txpool + +import ( + "fmt" + "math/big" + "testing" + "time" + + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/evm/ethchainadapter" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" +) + +func TestTxPool_AddTransaction_Pending(t *testing.T) { + chainID := datagenerator.RandomUInt64() + mockStore := newMockStorage() + mockRegistry := newMockBatchRegistry() + w := datagenerator.RandomWallet(int64(chainID)) + + genesisState, err := applyGenesisState(mockStore, []gethcommon.Address{w.Address()}) + require.NoError(t, err) + genesisBatch := &core.Batch{ + Header: &common.BatchHeader{ + ParentHash: common.L2BatchHash{}, + // L1Proof: common.ha, + Root: genesisState, + TxHash: types.EmptyRootHash, + Number: big.NewInt(int64(0)), + SequencerOrderNo: big.NewInt(int64(common.L2GenesisSeqNo)), // genesis batch has seq number 1 + ReceiptHash: types.EmptyRootHash, + TransfersTree: types.EmptyRootHash, + // Time: timeNow, + // Coinbase: coinbase, + // BaseFee: baseFee, + GasLimit: 1_000_000_000_000, // todo (@siliev) - does the batch header need uint64? + }, + Transactions: []*common.L2Tx{}, + } + + err = mockStore.StoreExecutedBatch(genesisBatch, nil) + require.NoError(t, err) + + mockRegistry.OnBatchExecuted(genesisBatch, nil) + + blockchain := ethchainadapter.NewEthChainAdapter( + big.NewInt(int64(chainID)), + mockRegistry, + mockStore, + testlog.Logger(), + ) + err = blockchain.IngestNewBlock(genesisBatch) + require.NoError(t, err) + + txPool, err := NewTxPool(blockchain, big.NewInt(1)) + require.NoError(t, err) + + // Start the TxPool + err = txPool.Start() + require.NoError(t, err) + + // Create and add a transaction + randAddr := datagenerator.RandomAddress() + transaction := &types.LegacyTx{ + Nonce: 0, + Value: big.NewInt(1_000_000_000), + Gas: uint64(1_000_000), + GasPrice: gethcommon.Big1, + To: &randAddr, + } + signedTx, err := w.SignTransaction(transaction) + require.NoError(t, err) + + err = txPool.Add(signedTx) + if err != nil { + t.Fatalf("Failed to add transaction: %v", err) + } + + time.Sleep(time.Second) // make sure the tx makes into the pool + + // Check if the transaction is in pending + pendingTxs := txPool.PendingTransactions() + require.Equal(t, len(pendingTxs), 1) + require.Equal(t, pendingTxs[w.Address()][0].Hash.Hex(), signedTx.Hash().Hex()) + + // TODO Mint a block and check if it's cleared from the pool +} + +func applyGenesisState(storage *mockStorage, accounts []gethcommon.Address) (common.StateRoot, error) { + statedb, err := state.New(types.EmptyRootHash, storage.stateDB, nil) + if err != nil { + return common.StateRoot{}, fmt.Errorf("could not create state DB. Cause: %w", err) + } + + // set the accounts funds + for _, acc := range accounts { + statedb.SetBalance(acc, big.NewInt(1_000_000_000_000_00)) + } + + _ = statedb.IntermediateRoot(true) + commit, err := statedb.Commit(0, true) + if err != nil { + return common.StateRoot{}, err + } + return commit, nil +} diff --git a/go/enclave/vkhandler/vk_handler.go b/go/enclave/vkhandler/vk_handler.go index e7d117603a..bae8416548 100644 --- a/go/enclave/vkhandler/vk_handler.go +++ b/go/enclave/vkhandler/vk_handler.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/common/viewingkey" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/enclave/vkhandler/vk_handler_test.go b/go/enclave/vkhandler/vk_handler_test.go index 11f2556cf7..bfd1bb9501 100644 --- a/go/enclave/vkhandler/vk_handler_test.go +++ b/go/enclave/vkhandler/vk_handler_test.go @@ -6,8 +6,8 @@ import ( "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" "github.com/stretchr/testify/assert" + "github.com/ten-protocol/go-ten/go/common/viewingkey" ) func TestVKHandler(t *testing.T) { diff --git a/go/ethadapter/erc20contractlib/erc20_contract_lib.go b/go/ethadapter/erc20contractlib/erc20_contract_lib.go index c23f3e27d7..162d0f4da8 100644 --- a/go/ethadapter/erc20contractlib/erc20_contract_lib.go +++ b/go/ethadapter/erc20contractlib/erc20_contract_lib.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/ethadapter/erc20contractlib/obscuro_ERC20_contract_ABI.go b/go/ethadapter/erc20contractlib/obscuro_ERC20_contract_ABI.go index c049a61129..2dd38c2713 100644 --- a/go/ethadapter/erc20contractlib/obscuro_ERC20_contract_ABI.go +++ b/go/ethadapter/erc20contractlib/obscuro_ERC20_contract_ABI.go @@ -5,7 +5,7 @@ import ( "strings" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" "github.com/ethereum/go-ethereum/accounts/abi" gethcommon "github.com/ethereum/go-ethereum/common" diff --git a/go/ethadapter/geth_rpc_client.go b/go/ethadapter/geth_rpc_client.go index 2b106a54b8..305bf83a68 100644 --- a/go/ethadapter/geth_rpc_client.go +++ b/go/ethadapter/geth_rpc_client.go @@ -11,12 +11,12 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" - "github.com/obscuronet/go-obscuro/go/common/retry" + "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" + "github.com/ten-protocol/go-ten/go/common/retry" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum" diff --git a/go/ethadapter/interface.go b/go/ethadapter/interface.go index 98290ed2a6..40a1bf7439 100644 --- a/go/ethadapter/interface.go +++ b/go/ethadapter/interface.go @@ -4,7 +4,7 @@ import ( "errors" "math/big" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum" diff --git a/go/ethadapter/l1_transaction.go b/go/ethadapter/l1_transaction.go index 4c04049063..b13d2bf004 100644 --- a/go/ethadapter/l1_transaction.go +++ b/go/ethadapter/l1_transaction.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -33,6 +33,11 @@ type L1RespondSecretTx struct { HostAddress string } +type L1SetImportantContractsTx struct { + Key string + NewAddress gethcommon.Address +} + // Sign signs the payload with a given private key func (l *L1RespondSecretTx) Sign(privateKey *ecdsa.PrivateKey) *L1RespondSecretTx { var data []byte diff --git a/go/ethadapter/mgmtcontractlib/mgmt_contract_ABI.go b/go/ethadapter/mgmtcontractlib/mgmt_contract_ABI.go index 4fbaed728f..78776d51f5 100644 --- a/go/ethadapter/mgmtcontractlib/mgmt_contract_ABI.go +++ b/go/ethadapter/mgmtcontractlib/mgmt_contract_ABI.go @@ -1,13 +1,16 @@ package mgmtcontractlib -import "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" +import "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" const ( - AddRollupMethod = "AddRollup" - RespondSecretMethod = "RespondNetworkSecret" - RequestSecretMethod = "RequestNetworkSecret" - InitializeSecretMethod = "InitializeNetworkSecret" //#nosec - GetHostAddressesMethod = "GetHostAddresses" + AddRollupMethod = "AddRollup" + RespondSecretMethod = "RespondNetworkSecret" + RequestSecretMethod = "RequestNetworkSecret" + InitializeSecretMethod = "InitializeNetworkSecret" //#nosec + GetHostAddressesMethod = "GetHostAddresses" + GetImportantContractKeysMethod = "GetImportantContractKeys" + SetImportantContractsMethod = "SetImportantContractAddress" + GetImportantAddressMethod = "importantContractAddresses" ) var MgmtContractABI = ManagementContract.ManagementContractMetaData.ABI diff --git a/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go b/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go index 63fd2f18b3..b9f683dcf5 100644 --- a/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go +++ b/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go @@ -9,11 +9,11 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/ethadapter" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" @@ -28,13 +28,23 @@ type MgmtContractLib interface { CreateRequestSecret(tx *ethadapter.L1RequestSecretTx) types.TxData CreateRespondSecret(tx *ethadapter.L1RespondSecretTx, verifyAttester bool) types.TxData CreateInitializeSecret(tx *ethadapter.L1InitializeSecretTx) types.TxData - GetHostAddresses() (ethereum.CallMsg, error) // DecodeTx receives a *types.Transaction and converts it to an common.L1Transaction DecodeTx(tx *types.Transaction) ethadapter.L1Transaction - // DecodeCallResponse unpacks a call response into a slice of strings. - DecodeCallResponse(callResponse []byte) ([][]string, error) GetContractAddr() *gethcommon.Address + + // The methods below are used to create call messages for mgmt contract data and unpack the responses + + GetHostAddressesMsg() (ethereum.CallMsg, error) + DecodeHostAddressesResponse(callResponse []byte) ([]string, error) + + SetImportantContractMsg(key string, address gethcommon.Address) (ethereum.CallMsg, error) + + GetImportantContractKeysMsg() (ethereum.CallMsg, error) + DecodeImportantContractKeysResponse(callResponse []byte) ([]string, error) + + GetImportantAddressCallMsg(key string) (ethereum.CallMsg, error) + DecodeImportantAddressResponse(callResponse []byte) (gethcommon.Address, error) } type contractLibImpl struct { @@ -93,6 +103,14 @@ func (c *contractLibImpl) DecodeTx(tx *types.Transaction) ethadapter.L1Transacti case InitializeSecretMethod: return c.unpackInitSecretTx(tx, method, contractCallData) + + case SetImportantContractsMethod: + tx, err := c.unpackSetImportantContractsTx(tx, method, contractCallData) + if err != nil { + c.logger.Warn("could not unpack set important contracts tx", log.ErrKey, err) + return nil + } + return tx } return nil @@ -180,7 +198,7 @@ func (c *contractLibImpl) CreateInitializeSecret(tx *ethadapter.L1InitializeSecr } } -func (c *contractLibImpl) GetHostAddresses() (ethereum.CallMsg, error) { +func (c *contractLibImpl) GetHostAddressesMsg() (ethereum.CallMsg, error) { data, err := c.contractABI.Pack(GetHostAddressesMethod) if err != nil { return ethereum.CallMsg{}, fmt.Errorf("could not pack the call data. Cause: %w", err) @@ -188,23 +206,108 @@ func (c *contractLibImpl) GetHostAddresses() (ethereum.CallMsg, error) { return ethereum.CallMsg{To: c.addr, Data: data}, nil } -func (c *contractLibImpl) DecodeCallResponse(callResponse []byte) ([][]string, error) { +func (c *contractLibImpl) DecodeHostAddressesResponse(callResponse []byte) ([]string, error) { unpackedResponse, err := c.contractABI.Unpack(GetHostAddressesMethod, callResponse) if err != nil { return nil, fmt.Errorf("could not unpack call response. Cause: %w", err) } - // We convert the returned interfaces to strings. - unpackedResponseStrings := make([][]string, 0, len(unpackedResponse)) - for _, obj := range unpackedResponse { - str, ok := obj.([]string) - if !ok { - return nil, fmt.Errorf("could not convert interface in call response to string") - } - unpackedResponseStrings = append(unpackedResponseStrings, str) + // We expect the response to be a list containing one element, that element is a list of address strings + if len(unpackedResponse) != 1 { + return nil, fmt.Errorf("unexpected number of results (%d) returned from call, response: %s", len(unpackedResponse), unpackedResponse) + } + addresses, ok := unpackedResponse[0].([]string) + if !ok { + return nil, fmt.Errorf("could not convert element in call response to list of strings") + } + + return addresses, nil +} + +func (c *contractLibImpl) GetContractNamesMsg() (ethereum.CallMsg, error) { + data, err := c.contractABI.Pack(GetImportantContractKeysMethod) + if err != nil { + return ethereum.CallMsg{}, fmt.Errorf("could not pack the call data. Cause: %w", err) + } + return ethereum.CallMsg{To: c.addr, Data: data}, nil +} + +func (c *contractLibImpl) DecodeContractNamesResponse(callResponse []byte) ([]string, error) { + unpackedResponse, err := c.contractABI.Unpack(GetImportantContractKeysMethod, callResponse) + if err != nil { + return nil, fmt.Errorf("could not unpack call response. Cause: %w", err) + } + + // We expect the response to be a list containing one element, that element is a list of address strings + if len(unpackedResponse) != 1 { + return nil, fmt.Errorf("unexpected number of results (%d) returned from call, response: %s", len(unpackedResponse), unpackedResponse) + } + contractNames, ok := unpackedResponse[0].([]string) + if !ok { + return nil, fmt.Errorf("could not convert element in call response to list of strings") + } + + return contractNames, nil +} + +func (c *contractLibImpl) SetImportantContractMsg(key string, address gethcommon.Address) (ethereum.CallMsg, error) { + data, err := c.contractABI.Pack(SetImportantContractsMethod, key, address) + if err != nil { + return ethereum.CallMsg{}, fmt.Errorf("could not pack the call data. Cause: %w", err) } + return ethereum.CallMsg{To: c.addr, Data: data}, nil +} - return unpackedResponseStrings, nil +func (c *contractLibImpl) GetImportantContractKeysMsg() (ethereum.CallMsg, error) { + data, err := c.contractABI.Pack(GetImportantContractKeysMethod) + if err != nil { + return ethereum.CallMsg{}, fmt.Errorf("could not pack the call data. Cause: %w", err) + } + return ethereum.CallMsg{To: c.addr, Data: data}, nil +} + +func (c *contractLibImpl) DecodeImportantContractKeysResponse(callResponse []byte) ([]string, error) { + unpackedResponse, err := c.contractABI.Unpack(GetImportantContractKeysMethod, callResponse) + if err != nil { + return nil, fmt.Errorf("could not unpack call response. Cause: %w", err) + } + + // We expect the response to be a list containing one element, that element is a list of address strings + if len(unpackedResponse) != 1 { + return nil, fmt.Errorf("unexpected number of results (%d) returned from call, response: %s", len(unpackedResponse), unpackedResponse) + } + contractNames, ok := unpackedResponse[0].([]string) + if !ok { + return nil, fmt.Errorf("could not convert element in call response to list of strings") + } + + return contractNames, nil +} + +func (c *contractLibImpl) GetImportantAddressCallMsg(key string) (ethereum.CallMsg, error) { + data, err := c.contractABI.Pack(GetImportantAddressMethod, key) + if err != nil { + return ethereum.CallMsg{}, fmt.Errorf("could not pack the call data. Cause: %w", err) + } + return ethereum.CallMsg{To: c.addr, Data: data}, nil +} + +func (c *contractLibImpl) DecodeImportantAddressResponse(callResponse []byte) (gethcommon.Address, error) { + unpackedResponse, err := c.contractABI.Unpack(GetImportantAddressMethod, callResponse) + if err != nil { + return gethcommon.Address{}, fmt.Errorf("could not unpack call response. Cause: %w", err) + } + + // We expect the response to be a list containing one element, that element is a list of address strings + if len(unpackedResponse) != 1 { + return gethcommon.Address{}, fmt.Errorf("unexpected number of results (%d) returned from call, response: %s", len(unpackedResponse), unpackedResponse) + } + address, ok := unpackedResponse[0].(gethcommon.Address) + if !ok { + return gethcommon.Address{}, fmt.Errorf("could not convert element in call response to list of strings") + } + + return address, nil } func (c *contractLibImpl) unpackInitSecretTx(tx *types.Transaction, method *abi.Method, contractCallData map[string]interface{}) *ethadapter.L1InitializeSecretTx { @@ -297,6 +400,36 @@ func (c *contractLibImpl) unpackRespondSecretTx(tx *types.Transaction, method *a } } +func (c *contractLibImpl) unpackSetImportantContractsTx(tx *types.Transaction, method *abi.Method, contractCallData map[string]interface{}) (*ethadapter.L1SetImportantContractsTx, error) { + err := method.Inputs.UnpackIntoMap(contractCallData, tx.Data()[methodBytesLen:]) + if err != nil { + return nil, fmt.Errorf("could not unpack transaction. Cause: %w", err) + } + + keyData, found := contractCallData["key"] + if !found { + return nil, fmt.Errorf("call data not found for key") + } + keyString, ok := keyData.(string) + if !ok { + return nil, fmt.Errorf("could not decode key data") + } + + contractAddressData, found := contractCallData["newAddress"] + if !found { + return nil, fmt.Errorf("call data not found for newAddress") + } + contractAddress, ok := contractAddressData.(gethcommon.Address) + if !ok { + return nil, fmt.Errorf("could not decode newAddress data") + } + + return ðadapter.L1SetImportantContractsTx{ + Key: keyString, + NewAddress: contractAddress, + }, nil +} + // base64EncodeToString encodes a byte array to a string func base64EncodeToString(bytes []byte) string { return base64.StdEncoding.EncodeToString(bytes) diff --git a/go/host/container/cli.go b/go/host/container/cli.go index 42b459b6f9..3d2da90b3e 100644 --- a/go/host/container/cli.go +++ b/go/host/container/cli.go @@ -6,11 +6,11 @@ import ( "os" "time" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/naoina/toml" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/host/container/cli_test.go b/go/host/container/cli_test.go index 0d9d055054..e5e6697eee 100644 --- a/go/host/container/cli_test.go +++ b/go/host/container/cli_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" ) const testToml = "/test.toml" diff --git a/go/host/container/host_container.go b/go/host/container/host_container.go index fe3380cb71..e065e611d6 100644 --- a/go/host/container/host_container.go +++ b/go/host/container/host_container.go @@ -5,24 +5,24 @@ import ( "time" gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/host/l1" + "github.com/ten-protocol/go-ten/go/host/l1" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/metrics" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/host" - "github.com/obscuronet/go-obscuro/go/host/p2p" - "github.com/obscuronet/go-obscuro/go/host/rpc/clientapi" - "github.com/obscuronet/go-obscuro/go/host/rpc/clientrpc" - "github.com/obscuronet/go-obscuro/go/host/rpc/enclaverpc" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/metrics" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/host" + "github.com/ten-protocol/go-ten/go/host/p2p" + "github.com/ten-protocol/go-ten/go/host/rpc/clientapi" + "github.com/ten-protocol/go-ten/go/host/rpc/clientrpc" + "github.com/ten-protocol/go-ten/go/host/rpc/enclaverpc" + "github.com/ten-protocol/go-ten/go/wallet" gethlog "github.com/ethereum/go-ethereum/log" - hostcommon "github.com/obscuronet/go-obscuro/go/common/host" + hostcommon "github.com/ten-protocol/go-ten/go/common/host" ) const ( diff --git a/go/host/db/batches.go b/go/host/db/batches.go index b117d7116c..8df76cc6b0 100644 --- a/go/host/db/batches.go +++ b/go/host/db/batches.go @@ -8,11 +8,11 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/pkg/errors" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // DB methods relating to batches. diff --git a/go/host/db/batches_test.go b/go/host/db/batches_test.go index 3d6fcd50c4..54289b6061 100644 --- a/go/host/db/batches_test.go +++ b/go/host/db/batches_test.go @@ -7,9 +7,9 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) func TestCanStoreAndRetrieveBatchHeader(t *testing.T) { diff --git a/go/host/db/blocks.go b/go/host/db/blocks.go index 0569f19e5f..a8596bcb2f 100644 --- a/go/host/db/blocks.go +++ b/go/host/db/blocks.go @@ -10,8 +10,8 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" ) // DB methods relating to block headers. diff --git a/go/host/db/blocks_test.go b/go/host/db/blocks_test.go index b094e4ee43..0649ebca77 100644 --- a/go/host/db/blocks_test.go +++ b/go/host/db/blocks_test.go @@ -5,7 +5,7 @@ import ( "math/big" "testing" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" "github.com/ethereum/go-ethereum/core/types" ) diff --git a/go/host/db/hostdb.go b/go/host/db/hostdb.go index 5cc7f1240d..ee8fda2d49 100644 --- a/go/host/db/hostdb.go +++ b/go/host/db/hostdb.go @@ -4,13 +4,13 @@ import ( "fmt" "os" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/config" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb/leveldb" gethlog "github.com/ethereum/go-ethereum/log" gethmetrics "github.com/ethereum/go-ethereum/metrics" - "github.com/obscuronet/go-obscuro/go/common/gethdb" + "github.com/ten-protocol/go-ten/go/common/gethdb" ) // Schema keys, in alphabetical order. diff --git a/go/host/db/leveldb.go b/go/host/db/leveldb.go index c8d64206be..49a3ec6cf3 100644 --- a/go/host/db/leveldb.go +++ b/go/host/db/leveldb.go @@ -5,8 +5,8 @@ import ( "github.com/ethereum/go-ethereum/ethdb" ethldb "github.com/ethereum/go-ethereum/ethdb/leveldb" - "github.com/obscuronet/go-obscuro/go/common/errutil" "github.com/syndtr/goleveldb/leveldb" + "github.com/ten-protocol/go-ten/go/common/errutil" ) // ObscuroLevelDB is a very thin wrapper around a level DB database for compatibility with our internal interfaces diff --git a/go/host/db/rollups.go b/go/host/db/rollups.go index 9df9eec10b..41ac34b80d 100644 --- a/go/host/db/rollups.go +++ b/go/host/db/rollups.go @@ -6,9 +6,9 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" "github.com/pkg/errors" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index ba00bfffa3..2069fcaa06 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -7,23 +7,23 @@ import ( "sync" "time" - "github.com/obscuronet/go-obscuro/go/common/stopcontrol" + "github.com/ten-protocol/go-ten/go/common/stopcontrol" gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/common/gethutil" "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/host/db" - "github.com/obscuronet/go-obscuro/go/host/l1" "github.com/pkg/errors" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/host/db" + "github.com/ten-protocol/go-ten/go/host/l1" ) const ( @@ -276,10 +276,7 @@ func (g *Guardian) provideSecret() error { if err != nil { return fmt.Errorf("next block after block=%s not found - %w", awaitFromBlock, err) } - secretRespTxs := g.sl.L1Publisher().ExtractSecretResponses(nextBlock) - if err != nil { - return fmt.Errorf("could not extract secret responses from block=%s - %w", nextBlock.Hash(), err) - } + secretRespTxs, _, _ := g.sl.L1Publisher().ExtractObscuroRelevantTransactions(nextBlock) for _, scrt := range secretRespTxs { if scrt.RequesterID.Hex() == g.hostData.ID.Hex() { err = g.enclaveClient.InitEnclave(scrt.Secret) @@ -435,13 +432,12 @@ func (g *Guardian) submitL1Block(block *common.L1Block, isLatest bool) (bool, er func (g *Guardian) processL1BlockTransactions(block *common.L1Block) { // if there are any secret responses in the block we should refresh our P2P list to re-sync with the network - respTxs := g.sl.L1Publisher().ExtractSecretResponses(block) - if len(respTxs) > 0 { + secretRespTxs, rollupTxs, contractAddressTxs := g.sl.L1Publisher().ExtractObscuroRelevantTransactions(block) + if len(secretRespTxs) > 0 { // new peers may have been granted access to the network, notify p2p service to refresh its peer list go g.sl.P2P().RefreshPeerList() } - rollupTxs := g.sl.L1Publisher().ExtractRollupTxs(block) for _, rollup := range rollupTxs { r, err := common.DecodeRollup(rollup.Rollup) if err != nil { @@ -456,6 +452,15 @@ func (g *Guardian) processL1BlockTransactions(block *common.L1Block) { } } } + + if len(contractAddressTxs) > 0 { + go func() { + err := g.sl.L1Publisher().ResyncImportantContracts() + if err != nil { + g.logger.Error("Could not resync important contracts", log.ErrKey, err) + } + }() + } } func (g *Guardian) publishSharedSecretResponses(scrtResponses []*common.ProducedSecretResponse) error { diff --git a/go/host/enclave/service.go b/go/host/enclave/service.go index a4cdfcbb9e..7a297cb463 100644 --- a/go/host/enclave/service.go +++ b/go/host/enclave/service.go @@ -7,11 +7,11 @@ import ( gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/responses" ) // This private interface enforces the services that the enclaves service depends on diff --git a/go/host/enclave/state.go b/go/host/enclave/state.go index c2ec1875f8..7808676a56 100644 --- a/go/host/enclave/state.go +++ b/go/host/enclave/state.go @@ -7,8 +7,8 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/gethutil" ) // This state machine compares the state of the enclave to the state of the world and is used to determine what actions can be taken with the enclave. diff --git a/go/host/enclave/state_test.go b/go/host/enclave/state_test.go index a8f222d934..99519738a0 100644 --- a/go/host/enclave/state_test.go +++ b/go/host/enclave/state_test.go @@ -6,8 +6,8 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" "github.com/stretchr/testify/assert" + "github.com/ten-protocol/go-ten/go/common/log" ) var ( diff --git a/go/host/events/logs.go b/go/host/events/logs.go index 82bb1b089e..bdf7578461 100644 --- a/go/host/events/logs.go +++ b/go/host/events/logs.go @@ -3,13 +3,13 @@ package events import ( "sync" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/log" "github.com/pkg/errors" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/log" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) type logSubsServiceLocator interface { diff --git a/go/host/host.go b/go/host/host.go index 1dacf03d54..62ae258025 100644 --- a/go/host/host.go +++ b/go/host/host.go @@ -4,28 +4,28 @@ import ( "encoding/json" "fmt" - "github.com/obscuronet/go-obscuro/go/host/l2" + "github.com/ten-protocol/go-ten/go/host/l2" - "github.com/obscuronet/go-obscuro/go/host/enclave" - "github.com/obscuronet/go-obscuro/go/host/l1" + "github.com/ten-protocol/go-ten/go/host/enclave" + "github.com/ten-protocol/go-ten/go/host/l1" "github.com/ethereum/go-ethereum/rpc" "github.com/naoina/toml" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/profiler" - "github.com/obscuronet/go-obscuro/go/common/stopcontrol" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/host/db" - "github.com/obscuronet/go-obscuro/go/host/events" - "github.com/obscuronet/go-obscuro/go/responses" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/profiler" + "github.com/ten-protocol/go-ten/go/common/stopcontrol" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/host/db" + "github.com/ten-protocol/go-ten/go/host/events" + "github.com/ten-protocol/go-ten/go/responses" + "github.com/ten-protocol/go-ten/go/wallet" gethlog "github.com/ethereum/go-ethereum/log" gethmetrics "github.com/ethereum/go-ethereum/metrics" - hostcommon "github.com/obscuronet/go-obscuro/go/common/host" + hostcommon "github.com/ten-protocol/go-ten/go/common/host" ) // Implementation of host.Host. @@ -204,8 +204,9 @@ func (h *host) ObscuroConfig() (*common.ObscuroNetworkInfo, error) { ManagementContractAddress: h.config.ManagementContractAddress, L1StartHash: h.config.L1StartHash, - SequencerID: h.config.SequencerID, - MessageBusAddress: h.config.MessageBusAddress, + SequencerID: h.config.SequencerID, + MessageBusAddress: h.config.MessageBusAddress, + ImportantContracts: h.services.L1Publisher().GetImportantContracts(), }, nil } diff --git a/go/host/l1/blockrepository.go b/go/host/l1/blockrepository.go index 2118e403be..5ccc5885df 100644 --- a/go/host/l1/blockrepository.go +++ b/go/host/l1/blockrepository.go @@ -7,18 +7,18 @@ import ( "sync/atomic" "time" - "github.com/obscuronet/go-obscuro/go/common/subscription" + "github.com/ten-protocol/go-ten/go/common/subscription" - "github.com/obscuronet/go-obscuro/go/common/host" + "github.com/ten-protocol/go-ten/go/common/host" "github.com/ethereum/go-ethereum" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/ethadapter" ) var ( diff --git a/go/host/l1/publisher.go b/go/host/l1/publisher.go index 06c7d9b972..1406e1bdf7 100644 --- a/go/host/l1/publisher.go +++ b/go/host/l1/publisher.go @@ -4,21 +4,22 @@ import ( "encoding/json" "fmt" "math/big" + "sync" "time" - "github.com/obscuronet/go-obscuro/go/common/stopcontrol" + "github.com/ten-protocol/go-ten/go/common/stopcontrol" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/wallet" "github.com/pkg/errors" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/wallet" ) type Publisher struct { @@ -27,6 +28,11 @@ type Publisher struct { ethClient ethadapter.EthClient mgmtContractLib mgmtcontractlib.MgmtContractLib // Library to handle Management Contract lib operations + // cached map of important contract addresses (updated when we see a SetImportantContractsTx) + importantContractAddresses map[string]gethcommon.Address + // lock for the important contract addresses map + importantAddressesMutex sync.RWMutex + repository host.L1BlockRepository logger gethlog.Logger @@ -57,10 +63,20 @@ func NewL1Publisher( logger: logger, maxWaitForL1Receipt: maxWaitForL1Receipt, retryIntervalForL1Receipt: retryIntervalForL1Receipt, + + importantContractAddresses: map[string]gethcommon.Address{}, + importantAddressesMutex: sync.RWMutex{}, } } func (p *Publisher) Start() error { + go func() { + // Do an initial read of important contract addresses when service starts up + err := p.ResyncImportantContracts() + if err != nil { + p.logger.Error("Could not load important contract addresses", log.ErrKey, err) + } + }() return nil } @@ -145,8 +161,12 @@ func (p *Publisher) PublishSecretResponse(secretResponse *common.ProducedSecretR return nil } -func (p *Publisher) ExtractSecretResponses(block *types.Block) []*ethadapter.L1RespondSecretTx { +// ExtractObscuroRelevantTransactions will extract any transactions from the block that are relevant to obscuro +// todo (#2495) we should monitor for relevant L1 events instead of scanning every transaction in the block +func (p *Publisher) ExtractObscuroRelevantTransactions(block *types.Block) ([]*ethadapter.L1RespondSecretTx, []*ethadapter.L1RollupTx, []*ethadapter.L1SetImportantContractsTx) { var secretRespTxs []*ethadapter.L1RespondSecretTx + var rollupTxs []*ethadapter.L1RollupTx + var contractAddressTxs []*ethadapter.L1SetImportantContractsTx for _, tx := range block.Transactions() { t := p.mgmtContractLib.DecodeTx(tx) if t == nil { @@ -154,23 +174,18 @@ func (p *Publisher) ExtractSecretResponses(block *types.Block) []*ethadapter.L1R } if scrtTx, ok := t.(*ethadapter.L1RespondSecretTx); ok { secretRespTxs = append(secretRespTxs, scrtTx) - } - } - return secretRespTxs -} - -func (p *Publisher) ExtractRollupTxs(block *types.Block) []*ethadapter.L1RollupTx { - var rollupTxs []*ethadapter.L1RollupTx - for _, tx := range block.Transactions() { - t := p.mgmtContractLib.DecodeTx(tx) - if t == nil { continue } if rollupTx, ok := t.(*ethadapter.L1RollupTx); ok { rollupTxs = append(rollupTxs, rollupTx) + continue + } + if contractAddressTx, ok := t.(*ethadapter.L1SetImportantContractsTx); ok { + contractAddressTxs = append(contractAddressTxs, contractAddressTx) + continue } } - return rollupTxs + return secretRespTxs, rollupTxs, contractAddressTxs } func (p *Publisher) FetchLatestSeqNo() (*big.Int, error) { @@ -208,7 +223,7 @@ func (p *Publisher) PublishRollup(producedRollup *common.ExtRollup) { } func (p *Publisher) FetchLatestPeersList() ([]string, error) { - msg, err := p.mgmtContractLib.GetHostAddresses() + msg, err := p.mgmtContractLib.GetHostAddressesMsg() if err != nil { return nil, err } @@ -216,11 +231,10 @@ func (p *Publisher) FetchLatestPeersList() ([]string, error) { if err != nil { return nil, err } - decodedResponse, err := p.mgmtContractLib.DecodeCallResponse(response) + hostAddresses, err := p.mgmtContractLib.DecodeHostAddressesResponse(response) if err != nil { return nil, err } - hostAddresses := decodedResponse[0] // We remove any duplicate addresses and our own address from the retrieved peer list var filteredHostAddresses []string @@ -239,6 +253,55 @@ func (p *Publisher) FetchLatestPeersList() ([]string, error) { return filteredHostAddresses, nil } +func (p *Publisher) GetImportantContracts() map[string]gethcommon.Address { + p.importantAddressesMutex.RLock() + defer p.importantAddressesMutex.RUnlock() + return p.importantContractAddresses +} + +// ResyncImportantContracts will fetch the latest important contracts from the management contract and update the cached map +// Note: this should be run in a goroutine as it makes L1 transactions in series and will block. +// Cache is not overwritten until it completes. +func (p *Publisher) ResyncImportantContracts() error { + getKeysCallMsg, err := p.mgmtContractLib.GetImportantContractKeysMsg() + if err != nil { + return fmt.Errorf("could not build callMsg for important contracts: %w", err) + } + keysResp, err := p.ethClient.CallContract(getKeysCallMsg) + if err != nil { + return fmt.Errorf("could not fetch important contracts: %w", err) + } + + importantContracts, err := p.mgmtContractLib.DecodeImportantContractKeysResponse(keysResp) + if err != nil { + return fmt.Errorf("could not decode important contracts resp: %w", err) + } + + contractsMap := make(map[string]gethcommon.Address) + + for _, contract := range importantContracts { + getAddressCallMsg, err := p.mgmtContractLib.GetImportantAddressCallMsg(contract) + if err != nil { + return fmt.Errorf("could not build callMsg for important contract=%s: %w", contract, err) + } + addrResp, err := p.ethClient.CallContract(getAddressCallMsg) + if err != nil { + return fmt.Errorf("could not fetch important contract=%s: %w", contract, err) + } + contractAddress, err := p.mgmtContractLib.DecodeImportantAddressResponse(addrResp) + if err != nil { + return fmt.Errorf("could not decode important contract=%s resp: %w", contract, err) + } + contractsMap[contract] = contractAddress + } + + p.importantAddressesMutex.Lock() + defer p.importantAddressesMutex.Unlock() + p.importantContractAddresses = contractsMap + + return nil +} + // publishTransaction will keep trying unless the L1 seems to be unavailable or the tx is otherwise rejected // It is responsible for keeping the nonce accurate, according to the following rules: // - Caller should not increment the wallet nonce before this method is called diff --git a/go/host/l2/batchrepository.go b/go/host/l2/batchrepository.go index bb3cd89f1b..78227310c7 100644 --- a/go/host/l2/batchrepository.go +++ b/go/host/l2/batchrepository.go @@ -8,12 +8,12 @@ import ( "time" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/host/db" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/host/db" ) const ( diff --git a/go/host/main/main.go b/go/host/main/main.go index c428843e53..e8ab9fae4f 100644 --- a/go/host/main/main.go +++ b/go/host/main/main.go @@ -3,8 +3,8 @@ package main import ( "fmt" - "github.com/obscuronet/go-obscuro/go/common/container" - hostcontainer "github.com/obscuronet/go-obscuro/go/host/container" + "github.com/ten-protocol/go-ten/go/common/container" + hostcontainer "github.com/ten-protocol/go-ten/go/host/container" ) // Runs an Obscuro host as a standalone process. diff --git a/go/host/p2p/p2p.go b/go/host/p2p/p2p.go index 8c49c727b1..876efc0ec3 100644 --- a/go/host/p2p/p2p.go +++ b/go/host/p2p/p2p.go @@ -9,18 +9,18 @@ import ( "sync/atomic" "time" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/common/measure" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/common/subscription" "github.com/pkg/errors" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/common/subscription" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/config" gethlog "github.com/ethereum/go-ethereum/log" gethmetrics "github.com/ethereum/go-ethereum/metrics" diff --git a/go/host/rpc/clientapi/client_api_debug.go b/go/host/rpc/clientapi/client_api_debug.go index bb5dc39974..5af064d386 100644 --- a/go/host/rpc/clientapi/client_api_debug.go +++ b/go/host/rpc/clientapi/client_api_debug.go @@ -3,8 +3,8 @@ package clientapi import ( "context" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/tracers" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/tracers" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/host/rpc/clientapi/client_api_eth.go b/go/host/rpc/clientapi/client_api_eth.go index 423a15cb13..49bdfe03bf 100644 --- a/go/host/rpc/clientapi/client_api_eth.go +++ b/go/host/rpc/clientapi/client_api_eth.go @@ -8,10 +8,10 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/responses" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" @@ -48,21 +48,21 @@ func (api *EthereumAPI) BlockNumber() hexutil.Uint64 { } // GetBlockByNumber returns the header of the batch with the given height. -func (api *EthereumAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, _ bool) (common.BatchHeader, error) { +func (api *EthereumAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, _ bool) (*common.BatchHeader, error) { batchHash, err := api.batchNumberToBatchHash(number) if err != nil { - return common.BatchHeader{}, fmt.Errorf("could not find batch with height %d. Cause: %w", number, err) + return nil, fmt.Errorf("could not find batch with height %d. Cause: %w", number, err) } return api.GetBlockByHash(ctx, *batchHash, true) } // GetBlockByHash returns the header of the batch with the given hash. -func (api *EthereumAPI) GetBlockByHash(_ context.Context, hash gethcommon.Hash, _ bool) (common.BatchHeader, error) { +func (api *EthereumAPI) GetBlockByHash(_ context.Context, hash gethcommon.Hash, _ bool) (*common.BatchHeader, error) { batchHeader, err := api.host.DB().GetBatchHeader(hash) if err != nil { - return common.BatchHeader{}, err + return nil, err } - return *batchHeader, nil + return batchHeader, nil } // GasPrice is a placeholder for an RPC method required by MetaMask/Remix. diff --git a/go/host/rpc/clientapi/client_api_filter.go b/go/host/rpc/clientapi/client_api_filter.go index f686fc0f7a..11a94b97f8 100644 --- a/go/host/rpc/clientapi/client_api_filter.go +++ b/go/host/rpc/clientapi/client_api_filter.go @@ -6,13 +6,13 @@ import ( "sync/atomic" "time" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/responses" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum/rpc" ) diff --git a/go/host/rpc/clientapi/client_api_net.go b/go/host/rpc/clientapi/client_api_net.go index 882c6bb86c..c259a9f169 100644 --- a/go/host/rpc/clientapi/client_api_net.go +++ b/go/host/rpc/clientapi/client_api_net.go @@ -3,7 +3,7 @@ package clientapi import ( "fmt" - "github.com/obscuronet/go-obscuro/go/common/host" + "github.com/ten-protocol/go-ten/go/common/host" ) // NetworkAPI implements a subset of the Ethereum network JSON RPC operations. diff --git a/go/host/rpc/clientapi/client_api_obscuro.go b/go/host/rpc/clientapi/client_api_obscuro.go index 7b0ce3643a..2c72a79767 100644 --- a/go/host/rpc/clientapi/client_api_obscuro.go +++ b/go/host/rpc/clientapi/client_api_obscuro.go @@ -1,8 +1,8 @@ package clientapi import ( - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/host" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/host" ) // ObscuroAPI implements Obscuro-specific JSON RPC operations. diff --git a/go/host/rpc/clientapi/client_api_obscuroscan.go b/go/host/rpc/clientapi/client_api_obscuroscan.go index 1996d9892d..153e5846de 100644 --- a/go/host/rpc/clientapi/client_api_obscuroscan.go +++ b/go/host/rpc/clientapi/client_api_obscuroscan.go @@ -5,13 +5,13 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/host" + "github.com/ten-protocol/go-ten/go/common/host" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) const txLimit = 100 diff --git a/go/host/rpc/clientapi/client_api_obscurotest.go b/go/host/rpc/clientapi/client_api_obscurotest.go index 76125db558..3c5ef1643c 100644 --- a/go/host/rpc/clientapi/client_api_obscurotest.go +++ b/go/host/rpc/clientapi/client_api_obscurotest.go @@ -1,7 +1,7 @@ package clientapi import ( - "github.com/obscuronet/go-obscuro/go/common/container" + "github.com/ten-protocol/go-ten/go/common/container" ) // TestAPI implements JSON RPC operations required for testing. diff --git a/go/host/rpc/clientapi/client_api_scan.go b/go/host/rpc/clientapi/client_api_scan.go index b1437d47f7..550696b104 100644 --- a/go/host/rpc/clientapi/client_api_scan.go +++ b/go/host/rpc/clientapi/client_api_scan.go @@ -4,8 +4,8 @@ import ( "math/big" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/host" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/host" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/host/rpc/clientrpc/rpc_server.go b/go/host/rpc/clientrpc/rpc_server.go index d63f0eb4de..cc0cf7794d 100644 --- a/go/host/rpc/clientrpc/rpc_server.go +++ b/go/host/rpc/clientrpc/rpc_server.go @@ -3,8 +3,8 @@ package clientrpc import ( "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/config" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/config" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/go/host/rpc/enclaverpc/enclave_client.go b/go/host/rpc/enclaverpc/enclave_client.go index 1d126961b3..f6ec0b6f1a 100644 --- a/go/host/rpc/enclaverpc/enclave_client.go +++ b/go/host/rpc/enclaverpc/enclave_client.go @@ -8,20 +8,20 @@ import ( "math/big" "time" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/measure" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/common/rpc" - "github.com/obscuronet/go-obscuro/go/common/rpc/generated" - "github.com/obscuronet/go-obscuro/go/common/syserr" - "github.com/obscuronet/go-obscuro/go/common/tracers" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/measure" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/common/rpc" + "github.com/ten-protocol/go-ten/go/common/rpc/generated" + "github.com/ten-protocol/go-ten/go/common/syserr" + "github.com/ten-protocol/go-ten/go/common/tracers" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/responses" "google.golang.org/grpc" "google.golang.org/grpc/connectivity" diff --git a/go/host/servicelocator.go b/go/host/servicelocator.go index 3a01b23ba3..d88cd86231 100644 --- a/go/host/servicelocator.go +++ b/go/host/servicelocator.go @@ -2,7 +2,7 @@ package host import ( "github.com/ethereum/go-ethereum/log" - hostcommon "github.com/obscuronet/go-obscuro/go/common/host" + hostcommon "github.com/ten-protocol/go-ten/go/common/host" ) type ServicesRegistry struct { diff --git a/go/node/README.md b/go/node/README.md index cdeda5439d..1acf839a88 100644 --- a/go/node/README.md +++ b/go/node/README.md @@ -1,3 +1,3 @@ # Node package -This package is responsible for orchestrating the start of various components that make up the obscuro node. +This package is responsible for orchestrating the start of various components that make up the ten node. diff --git a/go/node/cmd/main.go b/go/node/cmd/main.go index 289a49ac29..145222bd68 100644 --- a/go/node/cmd/main.go +++ b/go/node/cmd/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/obscuronet/go-obscuro/go/node" + "github.com/ten-protocol/go-ten/go/node" ) func main() { diff --git a/go/node/config.go b/go/node/config.go index b7c261454a..7aa3b93dce 100644 --- a/go/node/config.go +++ b/go/node/config.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/integration/common/testlog" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/node/docker_node.go b/go/node/docker_node.go index 1fe20a183e..11e7dc0a19 100644 --- a/go/node/docker_node.go +++ b/go/node/docker_node.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/sanity-io/litter" - "github.com/obscuronet/go-obscuro/go/common/docker" + "github.com/ten-protocol/go-ten/go/common/docker" ) var ( diff --git a/go/obsclient/README.md b/go/obsclient/README.md index 4ac72cf241..7ab9b3a2fb 100644 --- a/go/obsclient/README.md +++ b/go/obsclient/README.md @@ -1,12 +1,12 @@ This package is analogous to the ethclient package in go-ethereum. -It provides a higher level, standard way to interact with an Obscuro network programmatically. +It provides a higher level, standard way to interact with an Ten network programmatically. -It aims to provide all the same methods that the geth ethclient provides for compatibility/familiarity, as well as obscuro-specific methods. +It aims to provide all the same methods that the geth ethclient provides for compatibility/familiarity, as well as ten-specific methods. There are two clients, `ObsClient` and `AuthObsClient` -`ObsClient` just requires a Client and provides access to general Obscuro functionality that doesn't require viewing keys. +`ObsClient` just requires a Client and provides access to general Ten functionality that doesn't require viewing keys. `AuthObsClient` requires a EncRPCClient, which is an RPC client with an account and a signed Viewing Key for authentication. -It provides full Obscuro functionality, authenticating with the node and encrypting/decrypting sensitive requests. \ No newline at end of file +It provides full Ten functionality, authenticating with the node and encrypting/decrypting sensitive requests. \ No newline at end of file diff --git a/go/obsclient/authclient.go b/go/obsclient/authclient.go index d259b82c42..e1326903b2 100644 --- a/go/obsclient/authclient.go +++ b/go/obsclient/authclient.go @@ -8,11 +8,11 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" - "github.com/obscuronet/go-obscuro/go/responses" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/responses" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/go/wallet" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/go/obsclient/authclient_test.go b/go/obsclient/authclient_test.go index dddac38cac..68c365437e 100644 --- a/go/obsclient/authclient_test.go +++ b/go/obsclient/authclient_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/responses" - "github.com/obscuronet/go-obscuro/go/rpc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/ten-protocol/go-ten/go/responses" + "github.com/ten-protocol/go-ten/go/rpc" ) // These tests use a mocked RPC client, they test any transformations of the Go objects -> RPC params, as well as any diff --git a/go/obsclient/clientutil/clientutil.go b/go/obsclient/clientutil/clientutil.go index cbf3455212..07abed0c19 100644 --- a/go/obsclient/clientutil/clientutil.go +++ b/go/obsclient/clientutil/clientutil.go @@ -5,11 +5,11 @@ import ( "fmt" "time" - "github.com/obscuronet/go-obscuro/go/common/retry" + "github.com/ten-protocol/go-ten/go/common/retry" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/obsclient" ) var defaultTimeoutInterval = 1 * time.Second diff --git a/go/obsclient/encoding.go b/go/obsclient/encoding.go index b6fdb87c8f..f48f176682 100644 --- a/go/obsclient/encoding.go +++ b/go/obsclient/encoding.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/go/obsclient/obsclient.go b/go/obsclient/obsclient.go index 4643d75cc7..b16021f49f 100644 --- a/go/obsclient/obsclient.go +++ b/go/obsclient/obsclient.go @@ -7,11 +7,11 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/rpc" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/rpc" gethcommon "github.com/ethereum/go-ethereum/common" - hostcommon "github.com/obscuronet/go-obscuro/go/common/host" + hostcommon "github.com/ten-protocol/go-ten/go/common/host" ) // ObsClient provides access to general Obscuro functionality that doesn't require viewing keys. diff --git a/go/responses/responses.go b/go/responses/responses.go index f39838de05..68f843a326 100644 --- a/go/responses/responses.go +++ b/go/responses/responses.go @@ -4,8 +4,8 @@ import ( "encoding/json" "fmt" - "github.com/obscuronet/go-obscuro/go/common/syserr" - "github.com/obscuronet/go-obscuro/go/enclave/vkhandler" + "github.com/ten-protocol/go-ten/go/common/syserr" + "github.com/ten-protocol/go-ten/go/enclave/vkhandler" ) // InternalErrMsg is the common response returned to the user when an InternalError occurs diff --git a/go/rpc/README.md b/go/rpc/README.md index d1303e33ca..98e975e405 100644 --- a/go/rpc/README.md +++ b/go/rpc/README.md @@ -1,8 +1,8 @@ -This package contains library code to allow client applications to connect to Obscuro nodes via RPC. +This package contains library code to allow client applications to connect to Ten nodes via RPC. ### Viewing keys -Viewing keys are generated inside the wallet extension (or other users of the obscuro rpc client), and then signed by the wallet (e.g. MetaMask) +Viewing keys are generated inside the wallet extension (or other users of the ten rpc client), and then signed by the wallet (e.g. MetaMask) to which the keys relate. The keys are then are sent to the enclave via RPC and processed by: - checking the validity of the signature over the viewing key diff --git a/go/rpc/encrypted_client.go b/go/rpc/encrypted_client.go index 55389b7b7a..b06da4670a 100644 --- a/go/rpc/encrypted_client.go +++ b/go/rpc/encrypted_client.go @@ -14,11 +14,11 @@ import ( "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" - "github.com/obscuronet/go-obscuro/go/responses" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/responses" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/go/rpc/network_client.go b/go/rpc/network_client.go index 7b9b81415a..6aaf41faa9 100644 --- a/go/rpc/network_client.go +++ b/go/rpc/network_client.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/rpc" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/common/viewingkey" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/go/wallet/wallet.go b/go/wallet/wallet.go index 24547839ae..01922ca91b 100644 --- a/go/wallet/wallet.go +++ b/go/wallet/wallet.go @@ -8,7 +8,7 @@ import ( gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" diff --git a/integration/README.md b/integration/README.md index e567c3428a..3d3fc67b46 100644 --- a/integration/README.md +++ b/integration/README.md @@ -1,4 +1,4 @@ -These packages contain code related to the simulation and testing an end-to-end Obscuro network. +These packages contain code related to the simulation and testing an end-to-end Ten network. To include the Docker tests when running the tests, build the Docker images using the instructions in the `dockerfiles/` folder, then run the tests with the `docker` tag (e.g. `go test -v -tags docker ./...`). diff --git a/integration/common/constants.go b/integration/common/constants.go index a8c1c8bbaf..7934dd0e93 100644 --- a/integration/common/constants.go +++ b/integration/common/constants.go @@ -3,7 +3,7 @@ package common import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/wallet" ) // The Contract addresses are the result of the deploying a smart contract from hardcoded owners. diff --git a/integration/common/testlog/testlog.go b/integration/common/testlog/testlog.go index 82ad0a524b..02ccfb23c5 100644 --- a/integration/common/testlog/testlog.go +++ b/integration/common/testlog/testlog.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/integration/common/utils.go b/integration/common/utils.go index 5622104559..676e6db689 100644 --- a/integration/common/utils.go +++ b/integration/common/utils.go @@ -12,18 +12,18 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/ethclient" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/obsclient" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/wallet" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/rpc" + "github.com/ten-protocol/go-ten/go/rpc" ) -var _awaitReceiptPollingInterval = 100 * time.Millisecond +var _awaitReceiptPollingInterval = 200 * time.Millisecond func RndBtw(min uint64, max uint64) uint64 { if min >= max { diff --git a/integration/contractdeployer/contract_deployer_test.go b/integration/contractdeployer/contract_deployer_test.go index 398254b03c..423028caa1 100644 --- a/integration/contractdeployer/contract_deployer_test.go +++ b/integration/contractdeployer/contract_deployer_test.go @@ -8,20 +8,20 @@ import ( "time" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" - contractdeployer "github.com/obscuronet/go-obscuro/tools/hardhatdeployer" - - testcommon "github.com/obscuronet/go-obscuro/integration/common" + "github.com/ten-protocol/go-ten/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/stats" + contractdeployer "github.com/ten-protocol/go-ten/tools/hardhatdeployer" + + testcommon "github.com/ten-protocol/go-ten/integration/common" ) const ( @@ -33,7 +33,6 @@ const ( erc20ParamThree = "1000000000000000000" testLogs = "../.build/noderunner/" receiptTimeout = 30 * time.Second // The time to wait for a receipt for a transaction. - _portOffset = 1000 ) func init() { //nolint:gochecknoinits @@ -82,7 +81,7 @@ func TestCanDeployLayer2ERC20Contract(t *testing.T) { } func TestFaucetSendsFundsOnlyIfNeeded(t *testing.T) { - startPort := integration.StartPortContractDeployerTest + _portOffset + startPort := integration.StartPortContractDeployerTest hostWSPort := startPort + integration.DefaultHostRPCWSOffset createObscuroNetwork(t, startPort) diff --git a/integration/datagenerator/batch.go b/integration/datagenerator/batch.go index 82eaa91543..0d5774ed9f 100644 --- a/integration/datagenerator/batch.go +++ b/integration/datagenerator/batch.go @@ -6,7 +6,7 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // RandomBatch - block is needed in order to pass the smart contract check diff --git a/integration/datagenerator/common.go b/integration/datagenerator/common.go index 513b7bac12..a0d61e5656 100644 --- a/integration/datagenerator/common.go +++ b/integration/datagenerator/common.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/integration/datagenerator/rollup.go b/integration/datagenerator/rollup.go index 81cb02181c..184b4f64c0 100644 --- a/integration/datagenerator/rollup.go +++ b/integration/datagenerator/rollup.go @@ -3,7 +3,7 @@ package datagenerator import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // RandomRollup - block is needed in order to pass the smart contract check diff --git a/integration/datagenerator/wallet.go b/integration/datagenerator/wallet.go index ec9c20886a..098e6c2b49 100644 --- a/integration/datagenerator/wallet.go +++ b/integration/datagenerator/wallet.go @@ -3,9 +3,9 @@ package datagenerator import ( "encoding/hex" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/wallet" ) // RandomWallet returns a wallet with a random private key diff --git a/integration/erc20contract/contract.go b/integration/erc20contract/contract.go index 63898bb76f..3323883197 100644 --- a/integration/erc20contract/contract.go +++ b/integration/erc20contract/contract.go @@ -3,11 +3,11 @@ package erc20contract import ( "math/big" - "github.com/obscuronet/go-obscuro/integration/erc20contract/generated/EthERC20" + "github.com/ten-protocol/go-ten/integration/erc20contract/generated/EthERC20" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/integration/erc20contract/generated/ObsERC20" + "github.com/ten-protocol/go-ten/integration/erc20contract/generated/ObsERC20" ) func L2BytecodeWithDefaultSupply(tokenName string, busAddress common.Address) []byte { diff --git a/integration/eth2network/eth2_network.go b/integration/eth2network/eth2_network.go index 7a2c57f08b..bc85341365 100644 --- a/integration/eth2network/eth2_network.go +++ b/integration/eth2network/eth2_network.go @@ -13,10 +13,10 @@ import ( "strings" "time" - "github.com/obscuronet/go-obscuro/go/common/retry" + "github.com/ten-protocol/go-ten/go/common/retry" "github.com/ethereum/go-ethereum/ethclient" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/datagenerator" "golang.org/x/sync/errgroup" ) diff --git a/integration/eth2network/eth2_network_test.go b/integration/eth2network/eth2_network_test.go index 8d245e4a30..15511060cc 100644 --- a/integration/eth2network/eth2_network_test.go +++ b/integration/eth2network/eth2_network_test.go @@ -15,12 +15,12 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/datagenerator" "github.com/stretchr/testify/assert" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/datagenerator" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/integration/eth2network/main/main.go b/integration/eth2network/main/main.go index e31547dfe2..2a865e9630 100644 --- a/integration/eth2network/main/main.go +++ b/integration/eth2network/main/main.go @@ -7,7 +7,7 @@ import ( "syscall" "time" - "github.com/obscuronet/go-obscuro/integration/eth2network" + "github.com/ten-protocol/go-ten/integration/eth2network" ) // Spins up a new eth 2 network. diff --git a/integration/ethereummock/db.go b/integration/ethereummock/db.go index bb00b0bc04..6f806ab2e4 100644 --- a/integration/ethereummock/db.go +++ b/integration/ethereummock/db.go @@ -5,16 +5,16 @@ import ( "math/big" "sync" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/core" ) // Received blocks ar stored here diff --git a/integration/ethereummock/erc20_contract_lib.go b/integration/ethereummock/erc20_contract_lib.go index 83d7cd6ac4..e9b0117c86 100644 --- a/integration/ethereummock/erc20_contract_lib.go +++ b/integration/ethereummock/erc20_contract_lib.go @@ -5,8 +5,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/erc20contractlib" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/erc20contractlib" ) type contractLib struct{} diff --git a/integration/ethereummock/mgmt_contract_lib.go b/integration/ethereummock/mgmt_contract_lib.go index f16f35f54d..7201272cc1 100644 --- a/integration/ethereummock/mgmt_contract_lib.go +++ b/integration/ethereummock/mgmt_contract_lib.go @@ -4,16 +4,16 @@ import ( "bytes" "encoding/gob" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/datagenerator" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" ) var ( @@ -71,12 +71,32 @@ func (m *mockContractLib) CreateInitializeSecret(tx *ethadapter.L1InitializeSecr return encodeTx(tx, initializeSecretTxAddr) } -func (m *mockContractLib) GetHostAddresses() (ethereum.CallMsg, error) { +func (m *mockContractLib) GetHostAddressesMsg() (ethereum.CallMsg, error) { return ethereum.CallMsg{}, nil } -func (m *mockContractLib) DecodeCallResponse([]byte) ([][]string, error) { - return [][]string{{""}}, nil +func (m *mockContractLib) DecodeHostAddressesResponse([]byte) ([]string, error) { + return []string{""}, nil +} + +func (m *mockContractLib) GetImportantContractKeysMsg() (ethereum.CallMsg, error) { + return ethereum.CallMsg{}, nil +} + +func (m *mockContractLib) DecodeImportantContractKeysResponse([]byte) ([]string, error) { + return []string{""}, nil +} + +func (m *mockContractLib) SetImportantContractMsg(string, gethcommon.Address) (ethereum.CallMsg, error) { + return ethereum.CallMsg{}, nil +} + +func (m *mockContractLib) GetImportantAddressCallMsg(string) (ethereum.CallMsg, error) { + return ethereum.CallMsg{}, nil +} + +func (m *mockContractLib) DecodeImportantAddressResponse([]byte) (gethcommon.Address, error) { + return gethcommon.Address{}, nil } func decodeTx(tx *types.Transaction) ethadapter.L1Transaction { diff --git a/integration/ethereummock/mock_l1_network.go b/integration/ethereummock/mock_l1_network.go index 67438b68c1..f6dcd7613e 100644 --- a/integration/ethereummock/mock_l1_network.go +++ b/integration/ethereummock/mock_l1_network.go @@ -4,19 +4,19 @@ import ( "fmt" "time" - "github.com/obscuronet/go-obscuro/go/common/async" + "github.com/ten-protocol/go-ten/go/common/async" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" + "github.com/ten-protocol/go-ten/integration/simulation/stats" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" - testcommon "github.com/obscuronet/go-obscuro/integration/common" + testcommon "github.com/ten-protocol/go-ten/integration/common" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum/core/types" ) diff --git a/integration/ethereummock/node.go b/integration/ethereummock/node.go index 099dc22550..ef08ad230c 100644 --- a/integration/ethereummock/node.go +++ b/integration/ethereummock/node.go @@ -9,30 +9,30 @@ import ( "sync/atomic" "time" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" - "github.com/obscuronet/go-obscuro/go/common/async" + "github.com/ten-protocol/go-ten/go/common/async" "github.com/google/uuid" - "github.com/obscuronet/go-obscuro/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/common/gethutil" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/core/types" ethclient_ethereum "github.com/ethereum/go-ethereum/ethclient" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/erc20contractlib" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/erc20contractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" ) type L1Network interface { diff --git a/integration/ethereummock/utils.go b/integration/ethereummock/utils.go index c12eb81086..7e2ae1e02a 100644 --- a/integration/ethereummock/utils.go +++ b/integration/ethereummock/utils.go @@ -3,9 +3,9 @@ package ethereummock import ( "fmt" - "github.com/obscuronet/go-obscuro/go/enclave/storage" + "github.com/ten-protocol/go-ten/go/enclave/storage" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum/core/types" ) diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index 3085a5324e..a71826a515 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -12,17 +12,18 @@ import ( "time" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/tools/faucet/container" - "github.com/obscuronet/go-obscuro/tools/faucet/faucet" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/tools/faucet/container" + "github.com/ten-protocol/go-ten/tools/faucet/faucet" ) func init() { //nolint:gochecknoinits @@ -62,25 +63,25 @@ func TestFaucet(t *testing.T) { assert.NoError(t, err) initialFaucetBal, err := getFaucetBalance(faucetConfig.ServerPort) - assert.NoError(t, err) - assert.NotZero(t, initialFaucetBal) + require.NoError(t, err) + require.NotZero(t, initialFaucetBal) rndWallet := datagenerator.RandomWallet(integration.ObscuroChainID) err = fundWallet(faucetConfig.ServerPort, rndWallet) - assert.NoError(t, err) + require.NoError(t, err) obsClient, err := obsclient.DialWithAuth(fmt.Sprintf("http://%s:%d", network.Localhost, startPort+integration.DefaultHostRPCHTTPOffset), rndWallet, testlog.Logger()) - assert.NoError(t, err) + require.NoError(t, err) currentBalance, err := obsClient.BalanceAt(context.Background(), nil) - assert.NoError(t, err) + require.NoError(t, err) if currentBalance.Cmp(big.NewInt(0)) <= 0 { t.Fatalf("Unexpected balance, got: %d, expected > 0", currentBalance.Int64()) } endFaucetBal, err := getFaucetBalance(faucetConfig.ServerPort) - assert.NoError(t, err) + require.NoError(t, err) assert.NotZero(t, endFaucetBal) // faucet balance should have decreased assert.Less(t, endFaucetBal.Cmp(initialFaucetBal), 0) @@ -110,7 +111,7 @@ func createObscuroNetwork(t *testing.T, startPort int) { } func fundWallet(port int, w wallet.Wallet) error { - url := fmt.Sprintf("http://localhost:%d/fund/eth", port) + url := fmt.Sprintf("http://localhost:%d/auth/fund/eth", port) method := "POST" payload := strings.NewReader(fmt.Sprintf(`{"address":"%s"}`, w.Address())) @@ -121,6 +122,7 @@ func fundWallet(port int, w wallet.Wallet) error { return err } req.Header.Add("Content-Type", "application/json") + req.Header.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.xDOI1Cc30Zuj7VYKiRTqB2VntEKpZ5SkJW1heSsvzFw") res, err := client.Do(req) if err != nil { diff --git a/integration/manualtests/client_test.go b/integration/manualtests/client_test.go index 347298db63..7360af1c91 100644 --- a/integration/manualtests/client_test.go +++ b/integration/manualtests/client_test.go @@ -5,10 +5,10 @@ import ( "os" "testing" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" "github.com/stretchr/testify/assert" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" ) func TestClientGetRollup(t *testing.T) { diff --git a/integration/manualtests/connection_test.go b/integration/manualtests/connection_test.go index 55f30e8f7c..c307685c35 100644 --- a/integration/manualtests/connection_test.go +++ b/integration/manualtests/connection_test.go @@ -10,8 +10,8 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" - "github.com/obscuronet/go-obscuro/tools/walletextension/lib" "github.com/stretchr/testify/require" + "github.com/ten-protocol/go-ten/tools/walletextension/lib" ) func TestSubscribeToOG(t *testing.T) { diff --git a/integration/manualtests/tx_test.go b/integration/manualtests/tx_test.go index 3d27831ab9..d79336487d 100644 --- a/integration/manualtests/tx_test.go +++ b/integration/manualtests/tx_test.go @@ -13,15 +13,15 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/datagenerator" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/datagenerator" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" @@ -154,7 +154,7 @@ func TestL2IssueContractInteractWaitReceipt(t *testing.T) { require.NoError(t, err) if balance.Cmp(big.NewInt(0)) <= 0 { - t.Errorf("not enough balance: has %s has %s obx", l2Wallet.Address().Hex(), balance.String()) + t.Errorf("not enough balance: has %s has %s ten", l2Wallet.Address().Hex(), balance.String()) } storeContractBytecode := "0x608060405234801561001057600080fd5b506101f3806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100da565b60405180910390f35b610073600480360381019061006e9190610126565b61007e565b005b60008054905090565b806000819055507febfcf7c0a1b09f6499e519a8d8bb85ce33cd539ec6cbd964e116cd74943ead1a33826040516100b6929190610194565b60405180910390a150565b6000819050919050565b6100d4816100c1565b82525050565b60006020820190506100ef60008301846100cb565b92915050565b600080fd5b610103816100c1565b811461010e57600080fd5b50565b600081359050610120816100fa565b92915050565b60006020828403121561013c5761013b6100f5565b5b600061014a84828501610111565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061017e82610153565b9050919050565b61018e81610173565b82525050565b60006040820190506101a96000830185610185565b6101b660208301846100cb565b939250505056fea264697066735822122071ae4262a5da0c5c7b417d9c6cd13b57b8fcfe79c9c526b96f482ee67ff3136c64736f6c63430008120033" @@ -327,7 +327,7 @@ func TestL2IssueTxWaitReceipt(t *testing.T) { require.NoError(t, err) if balance.Cmp(big.NewInt(0)) <= 0 { - t.Fatalf("not enough balance: has %s has %s obx", l2Wallet.Address().Hex(), balance.String()) + t.Fatalf("not enough balance: has %s has %s ten", l2Wallet.Address().Hex(), balance.String()) } fmt.Println("balance: ", balance.String()) @@ -394,7 +394,7 @@ func TestL2IssueContractSubscribeChange(t *testing.T) { require.NoError(t, err) if balance.Cmp(big.NewInt(0)) <= 0 { - t.Errorf("not enough balance: has %s has %s obx", l2Wallet.Address().Hex(), balance.String()) + t.Errorf("not enough balance: has %s has %s ten", l2Wallet.Address().Hex(), balance.String()) } storeContractBytecode := "608060405234801561001057600080fd5b506101d7806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80630f2723ea14610030575b600080fd5b61004a60048036038101906100459190610137565b61004c565b005b8173ffffffffffffffffffffffffffffffffffffffff167fe86bd59ccd77aa1a9fbc46604e341e1dcc72f2a6e6637d5422736d645a71625e826040516100929190610186565b60405180910390a25050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100ce826100a3565b9050919050565b6100de816100c3565b81146100e957600080fd5b50565b6000813590506100fb816100d5565b92915050565b6000819050919050565b61011481610101565b811461011f57600080fd5b50565b6000813590506101318161010b565b92915050565b6000806040838503121561014e5761014d61009e565b5b600061015c858286016100ec565b925050602061016d85828601610122565b9150509250929050565b61018081610101565b82525050565b600060208201905061019b6000830184610177565b9291505056fea2646970667358221220d45d57b217a07cfd4ceecc8f5d2a9194a098e5fe1de98bc56c24cc400e21c96064736f6c63430008120033" diff --git a/integration/networktest/actions/context.go b/integration/networktest/actions/context.go index 578ef2b0d5..c54536b1af 100644 --- a/integration/networktest/actions/context.go +++ b/integration/networktest/actions/context.go @@ -6,7 +6,7 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/integration/networktest/userwallet" + "github.com/ten-protocol/go-ten/integration/networktest/userwallet" ) // KeyNumberOfTestUsers key to an int representing number of test users created/available diff --git a/integration/networktest/actions/l1/important_contracts.go b/integration/networktest/actions/l1/important_contracts.go new file mode 100644 index 0000000000..cc8fa4279c --- /dev/null +++ b/integration/networktest/actions/l1/important_contracts.go @@ -0,0 +1,106 @@ +package l1 + +import ( + "context" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/networktest" +) + +type setImportantContract struct { + contractKey string + contractAddress common.Address +} + +func SetImportantContract(contractKey string, contractAddress common.Address) networktest.Action { + return &setImportantContract{ + contractKey: contractKey, + contractAddress: contractAddress, + } +} + +func (s *setImportantContract) Run(ctx context.Context, network networktest.NetworkConnector) (context.Context, error) { + obsClient, err := obsclient.Dial(network.ValidatorRPCAddress(0)) + if err != nil { + return ctx, errors.Wrap(err, "failed to dial obsClient") + } + + networkCfg, err := obsClient.GetConfig() + if err != nil { + return ctx, errors.Wrap(err, "failed to get network config") + } + + l1Client, err := network.GetL1Client() + if err != nil { + return ctx, errors.Wrap(err, "failed to get L1 client") + } + + mgmtContract := mgmtcontractlib.NewMgmtContractLib(&networkCfg.ManagementContractAddress, testlog.Logger()) + + msg, err := mgmtContract.SetImportantContractMsg(s.contractKey, s.contractAddress) + if err != nil { + return ctx, errors.Wrap(err, "failed to create SetImportantContractMsg") + } + + txData := &types.LegacyTx{ + To: &networkCfg.ManagementContractAddress, + Data: msg.Data, + } + mcOwner, err := network.GetMCOwnerWallet() + if err != nil { + return ctx, errors.Wrap(err, "failed to get MC owner wallet") + } + // !! Important note !! + // The ownerOnly check in the contract doesn't like the gas estimate in here, to test you may need to hardcode a + // the gas value when the estimate errors + tx, err := l1Client.PrepareTransactionToSend(txData, networkCfg.ManagementContractAddress, mcOwner.GetNonceAndIncrement()) + if err != nil { + return ctx, errors.Wrap(err, "failed to prepare tx") + } + signedTx, err := mcOwner.SignTransaction(tx) + if err != nil { + return ctx, errors.Wrap(err, "failed to sign tx") + } + err = l1Client.SendTransaction(signedTx) + if err != nil { + return nil, errors.Wrap(err, "failed to send tx") + } + + // wait for tx to be mined + return ctx, retry.Do(func() error { + receipt, err := l1Client.TransactionReceipt(signedTx.Hash()) + if err != nil { + return err + } + if receipt.Status != types.ReceiptStatusSuccessful { + return retry.FailFast(errors.New("tx failed")) + } + return nil + }, retry.NewTimeoutStrategy(15*time.Second, 1*time.Second)) +} + +func (s *setImportantContract) Verify(_ context.Context, network networktest.NetworkConnector) error { + cli, err := obsclient.Dial(network.ValidatorRPCAddress(0)) + if err != nil { + return errors.Wrap(err, "failed to dial obsClient") + } + networkCfg, err := cli.GetConfig() + if err != nil { + return errors.Wrap(err, "failed to get network config") + } + + if networkCfg.ImportantContracts == nil || len(networkCfg.ImportantContracts) == 0 { + return errors.New("no important contracts set") + } + if addr, ok := networkCfg.ImportantContracts[s.contractKey]; !ok || addr != s.contractAddress { + return errors.New("important contract not set") + } + return nil +} diff --git a/integration/networktest/actions/multiple_actions.go b/integration/networktest/actions/multiple_actions.go index 041f3b65fb..55f075d6d3 100644 --- a/integration/networktest/actions/multiple_actions.go +++ b/integration/networktest/actions/multiple_actions.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest" "golang.org/x/sync/errgroup" ) diff --git a/integration/networktest/actions/native_fund_actions.go b/integration/networktest/actions/native_fund_actions.go index 8b52ec9295..2f27dc42cd 100644 --- a/integration/networktest/actions/native_fund_actions.go +++ b/integration/networktest/actions/native_fund_actions.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/userwallet" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/userwallet" ) type SendNativeFunds struct { diff --git a/integration/networktest/actions/node_actions.go b/integration/networktest/actions/node_actions.go index 39af8e38e8..c6da34fc80 100644 --- a/integration/networktest/actions/node_actions.go +++ b/integration/networktest/actions/node_actions.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/integration/networktest" ) func StartValidatorEnclave(validatorIdx int) networktest.Action { diff --git a/integration/networktest/actions/setup_actions.go b/integration/networktest/actions/setup_actions.go index f19dcd2c08..9bef943c54 100644 --- a/integration/networktest/actions/setup_actions.go +++ b/integration/networktest/actions/setup_actions.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/userwallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/userwallet" ) type CreateTestUser struct { diff --git a/integration/networktest/actions/snapshot_actions.go b/integration/networktest/actions/snapshot_actions.go index 26f9df0b27..a96c2ee3e2 100644 --- a/integration/networktest/actions/snapshot_actions.go +++ b/integration/networktest/actions/snapshot_actions.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest" ) // standard snapshots to use as reference points across all tests diff --git a/integration/networktest/actions/traffic_actions.go b/integration/networktest/actions/traffic_actions.go index a949866eab..a5082b75ed 100644 --- a/integration/networktest/actions/traffic_actions.go +++ b/integration/networktest/actions/traffic_actions.go @@ -7,8 +7,8 @@ import ( "math/rand" "time" - "github.com/obscuronet/go-obscuro/integration/common" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/integration/common" + "github.com/ten-protocol/go-ten/integration/networktest" ) const _minTransferAmt = 1_000_000 diff --git a/integration/networktest/actions/util_actions.go b/integration/networktest/actions/util_actions.go index 63663c9946..ceab5a9508 100644 --- a/integration/networktest/actions/util_actions.go +++ b/integration/networktest/actions/util_actions.go @@ -4,8 +4,8 @@ import ( "context" "time" - "github.com/obscuronet/go-obscuro/integration/common" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/integration/common" + "github.com/ten-protocol/go-ten/integration/networktest" ) // SetContextValue is a simple action step that just sets a value on the context diff --git a/integration/networktest/env/dev_network.go b/integration/networktest/env/dev_network.go index c28136c015..89281d564d 100644 --- a/integration/networktest/env/dev_network.go +++ b/integration/networktest/env/dev_network.go @@ -4,12 +4,12 @@ import ( "fmt" "time" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/wallet" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/simulation/devnetwork" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/simulation/devnetwork" ) type devNetworkEnv struct { diff --git a/integration/networktest/env/network_setup.go b/integration/networktest/env/network_setup.go index 7ac7a59cfc..ad36a02c69 100644 --- a/integration/networktest/env/network_setup.go +++ b/integration/networktest/env/network_setup.go @@ -1,8 +1,8 @@ package env import ( - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/integration/networktest" ) func SepoliaTestnet() networktest.Environment { diff --git a/integration/networktest/env/testnet.go b/integration/networktest/env/testnet.go index 0e4a3868a5..3f7001909a 100644 --- a/integration/networktest/env/testnet.go +++ b/integration/networktest/env/testnet.go @@ -4,22 +4,25 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "math/big" "net/http" "time" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/integration/networktest/userwallet" + "github.com/ten-protocol/go-ten/integration/networktest/userwallet" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration" + "github.com/ten-protocol/go-ten/integration" gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest" ) var _defaultFaucetAmount = big.NewInt(750_000_000_000_000) @@ -124,3 +127,7 @@ func (t *testnetConnector) AllocateFaucetFundsWithWallet(ctx context.Context, ac } return nil } + +func (t *testnetConnector) GetMCOwnerWallet() (wallet.Wallet, error) { + return nil, errors.New("testnet connector environments cannot access the MC owner wallet") +} diff --git a/integration/networktest/interfaces.go b/integration/networktest/interfaces.go index 1280f39936..acc27fb7f7 100644 --- a/integration/networktest/interfaces.go +++ b/integration/networktest/interfaces.go @@ -3,14 +3,17 @@ package networktest import ( "context" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" "github.com/ethereum/go-ethereum/common" ) // NetworkConnector represents the network being tested against, e.g. testnet, dev-testnet, dev-sim // -// It provides network details (standard contract addresses) and easy client setup for sim users +// # It provides network details (standard contract addresses) and easy client setup for sim users +// +// Note: some of these methods may not be available for some networks (e.g. MC Owner wallet for live testnets) type NetworkConnector interface { ChainID() int64 // AllocateFaucetFunds uses the networks default faucet mechanism for allocating funds to a test account @@ -21,6 +24,7 @@ type NetworkConnector interface { GetSequencerNode() NodeOperator GetValidatorNode(idx int) NodeOperator GetL1Client() (ethadapter.EthClient, error) + GetMCOwnerWallet() (wallet.Wallet, error) // wallet that owns the management contract (network admin) } // Action is any step in a test, they will typically be either minimally small steps in the test or they will be containers diff --git a/integration/networktest/log.go b/integration/networktest/log.go index 8166aa8c25..ff2c45294d 100644 --- a/integration/networktest/log.go +++ b/integration/networktest/log.go @@ -4,7 +4,7 @@ import ( "os" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" ) // EnsureTestLogsSetUp calls Setup if it hasn't already been called (some tests run tests within themselves, we don't want diff --git a/integration/networktest/tests/bridge/important_contracts_test.go b/integration/networktest/tests/bridge/important_contracts_test.go new file mode 100644 index 0000000000..e608569a98 --- /dev/null +++ b/integration/networktest/tests/bridge/important_contracts_test.go @@ -0,0 +1,23 @@ +package bridge + +import ( + "testing" + + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/actions/l1" + "github.com/ten-protocol/go-ten/integration/networktest/env" +) + +func TestImportantContractsLookup(t *testing.T) { + networktest.TestOnlyRunsInIDE(t) + networktest.Run( + "important-contracts-lookup", + t, + env.LocalDevNetwork(), + actions.Series( + l1.SetImportantContract("L1TestContract", gethcommon.HexToAddress("0x64")), + ), + ) +} diff --git a/integration/networktest/tests/gas/gas_test.go b/integration/networktest/tests/gas/gas_test.go index ec35d16629..775ecd7bc3 100644 --- a/integration/networktest/tests/gas/gas_test.go +++ b/integration/networktest/tests/gas/gas_test.go @@ -10,10 +10,10 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/actions" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) // Smoke tests are useful for checking a network is live or checking basic functionality is not broken diff --git a/integration/networktest/tests/helpful/availability_test.go b/integration/networktest/tests/helpful/availability_test.go index 114a46cda9..a9ff34e9d8 100644 --- a/integration/networktest/tests/helpful/availability_test.go +++ b/integration/networktest/tests/helpful/availability_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/obsclient" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/actions" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) const _testTimeSpan = 120 * time.Second diff --git a/integration/networktest/tests/helpful/smoke_test.go b/integration/networktest/tests/helpful/smoke_test.go index b077a8f9c6..44ce892d60 100644 --- a/integration/networktest/tests/helpful/smoke_test.go +++ b/integration/networktest/tests/helpful/smoke_test.go @@ -4,10 +4,10 @@ import ( "math/big" "testing" - "github.com/obscuronet/go-obscuro/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/actions" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) // Smoke tests are useful for checking a network is live or checking basic functionality is not broken diff --git a/integration/networktest/tests/helpful/spin_up_local_network_test.go b/integration/networktest/tests/helpful/spin_up_local_network_test.go index 7045d08886..83a5f4888c 100644 --- a/integration/networktest/tests/helpful/spin_up_local_network_test.go +++ b/integration/networktest/tests/helpful/spin_up_local_network_test.go @@ -10,12 +10,12 @@ import ( "time" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) const ( diff --git a/integration/networktest/tests/load/load_test.go b/integration/networktest/tests/load/load_test.go index f7ceb780b3..e75b83973d 100644 --- a/integration/networktest/tests/load/load_test.go +++ b/integration/networktest/tests/load/load_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/actions" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) func TestNativeTransfers(t *testing.T) { diff --git a/integration/networktest/tests/nodescenario/restart_network_test.go b/integration/networktest/tests/nodescenario/restart_network_test.go index a0bca08d8e..42a64307a1 100644 --- a/integration/networktest/tests/nodescenario/restart_network_test.go +++ b/integration/networktest/tests/nodescenario/restart_network_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/actions" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) // restart both the sequencer and the validators (the entire network) diff --git a/integration/networktest/tests/nodescenario/restart_validator_enclave_test.go b/integration/networktest/tests/nodescenario/restart_validator_enclave_test.go index cb16e4c3e5..1559bd8d7b 100644 --- a/integration/networktest/tests/nodescenario/restart_validator_enclave_test.go +++ b/integration/networktest/tests/nodescenario/restart_validator_enclave_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/actions" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) func TestRestartValidatorEnclave(t *testing.T) { diff --git a/integration/networktest/tests/nodescenario/restart_validator_test.go b/integration/networktest/tests/nodescenario/restart_validator_test.go index 01ffcbf9fa..2c6f3b8f2f 100644 --- a/integration/networktest/tests/nodescenario/restart_validator_test.go +++ b/integration/networktest/tests/nodescenario/restart_validator_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration/networktest/actions" + "github.com/ten-protocol/go-ten/integration/networktest/actions" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/networktest/env" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/networktest/env" ) // restart both the host and the enclave for a validator diff --git a/integration/networktest/userwallet/userwallet.go b/integration/networktest/userwallet/userwallet.go index 99d0603b2d..a1f2f8b2fb 100644 --- a/integration/networktest/userwallet/userwallet.go +++ b/integration/networktest/userwallet/userwallet.go @@ -8,18 +8,18 @@ import ( "math/big" "time" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/integration/networktest" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/networktest" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/integration" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/integration" ) const ( diff --git a/integration/networktest/util.go b/integration/networktest/util.go index c9de38c731..4ec1f924d4 100644 --- a/integration/networktest/util.go +++ b/integration/networktest/util.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/obsclient" ) // IDEFlag is used as an environnment variable to allow tests to run that are designed not to run in CI diff --git a/integration/noderunner/in_memory_node.go b/integration/noderunner/in_memory_node.go index aa644f7d41..ab6a49fe45 100644 --- a/integration/noderunner/in_memory_node.go +++ b/integration/noderunner/in_memory_node.go @@ -3,17 +3,17 @@ package noderunner import ( "fmt" - "github.com/obscuronet/go-obscuro/go/node" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/node" + "github.com/ten-protocol/go-ten/go/wallet" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" "github.com/sanity-io/litter" - enclavecontainer "github.com/obscuronet/go-obscuro/go/enclave/container" - hostcontainer "github.com/obscuronet/go-obscuro/go/host/container" + enclavecontainer "github.com/ten-protocol/go-ten/go/enclave/container" + hostcontainer "github.com/ten-protocol/go-ten/go/host/container" ) type InMemNode struct { diff --git a/integration/noderunner/noderunner_test.go b/integration/noderunner/noderunner_test.go index 635ead7623..f0b979bfc6 100644 --- a/integration/noderunner/noderunner_test.go +++ b/integration/noderunner/noderunner_test.go @@ -9,12 +9,12 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/go/common/profiler" - "github.com/obscuronet/go-obscuro/go/node" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/eth2network" + "github.com/ten-protocol/go-ten/go/common/profiler" + "github.com/ten-protocol/go-ten/go/node" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/eth2network" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/integration/obscurogateway/gateway_user.go b/integration/obscurogateway/gateway_user.go index 731f0128df..9ea6fe699a 100644 --- a/integration/obscurogateway/gateway_user.go +++ b/integration/obscurogateway/gateway_user.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/obscuronet/go-obscuro/tools/walletextension/lib" + "github.com/ten-protocol/go-ten/tools/walletextension/lib" "github.com/ethereum/go-ethereum/ethclient" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/wallet" ) // GatewayUser TODO (@ziga) refactor GatewayUser and integrate it with OGlib. diff --git a/integration/obscurogateway/obscurogateway_test.go b/integration/obscurogateway/obscurogateway_test.go index 96773f8aa9..65f0391997 100644 --- a/integration/obscurogateway/obscurogateway_test.go +++ b/integration/obscurogateway/obscurogateway_test.go @@ -12,28 +12,28 @@ import ( "time" "github.com/ethereum/go-ethereum" - wecommon "github.com/obscuronet/go-obscuro/tools/walletextension/common" + wecommon "github.com/ten-protocol/go-ten/tools/walletextension/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/httputil" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - integrationCommon "github.com/obscuronet/go-obscuro/integration/common" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/tools/walletextension/config" - "github.com/obscuronet/go-obscuro/tools/walletextension/container" - "github.com/obscuronet/go-obscuro/tools/walletextension/lib" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/httputil" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + integrationCommon "github.com/ten-protocol/go-ten/integration/common" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/tools/walletextension/config" + "github.com/ten-protocol/go-ten/tools/walletextension/container" + "github.com/ten-protocol/go-ten/tools/walletextension/lib" "github.com/valyala/fasthttp" ) diff --git a/integration/obscuroscan/obscuroscan_test.go b/integration/obscuroscan/obscuroscan_test.go index e89acab30a..b8feb958fe 100644 --- a/integration/obscuroscan/obscuroscan_test.go +++ b/integration/obscuroscan/obscuroscan_test.go @@ -12,25 +12,25 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common/viewingkey" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend/config" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend/container" "github.com/stretchr/testify/require" + "github.com/ten-protocol/go-ten/go/common/viewingkey" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend/config" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend/container" "github.com/valyala/fasthttp" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" "github.com/stretchr/testify/assert" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) func init() { //nolint:gochecknoinits @@ -81,7 +81,7 @@ func TestObscuroscan(t *testing.T) { statusCode, body, err := fasthttp.Get(nil, fmt.Sprintf("%s/count/contracts/", serverAddress)) assert.NoError(t, err) assert.Equal(t, 200, statusCode) - assert.Equal(t, "{\"count\":1}", string(body)) + assert.Equal(t, "{\"count\":2}", string(body)) statusCode, body, err = fasthttp.Get(nil, fmt.Sprintf("%s/count/transactions/", serverAddress)) assert.NoError(t, err) @@ -120,8 +120,8 @@ func TestObscuroscan(t *testing.T) { publicTxsObj := publicTxsRes{} err = json.Unmarshal(body, &publicTxsObj) assert.NoError(t, err) - assert.Equal(t, 5, len(publicTxsObj.Result.TransactionsData)) - assert.Equal(t, uint64(5), publicTxsObj.Result.Total) + assert.Equal(t, 6, len(publicTxsObj.Result.TransactionsData)) + assert.Equal(t, uint64(6), publicTxsObj.Result.Total) statusCode, body, err = fasthttp.Get(nil, fmt.Sprintf("%s/items/batches/?offset=0&size=10", serverAddress)) assert.NoError(t, err) @@ -235,16 +235,17 @@ func issueTransactions(t *testing.T, hostWSAddr string, issuerWallet wallet.Wall assert.Nil(t, err) if balance.Cmp(big.NewInt(0)) <= 0 { - t.Errorf("not enough balance: has %s has %s obx", issuerWallet.Address().Hex(), balance.String()) + t.Errorf("not enough balance: has %s has %s ten", issuerWallet.Address().Hex(), balance.String()) } + nonce, err := authClient.NonceAt(ctx, nil) + assert.Nil(t, err) + issuerWallet.SetNonce(nonce) + var receipts []gethcommon.Hash for i := 0; i < numbTxs; i++ { toAddr := datagenerator.RandomAddress() - nonce, err := authClient.NonceAt(ctx, nil) - assert.Nil(t, err) - issuerWallet.SetNonce(nonce) estimatedTx := authClient.EstimateGasAndGasPrice(&types.LegacyTx{ Nonce: issuerWallet.GetNonceAndIncrement(), To: &toAddr, diff --git a/integration/simulation/devnetwork/config.go b/integration/simulation/devnetwork/config.go index ec72cbc8ac..140577b469 100644 --- a/integration/simulation/devnetwork/config.go +++ b/integration/simulation/devnetwork/config.go @@ -8,13 +8,13 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/wallet" - testcommon "github.com/obscuronet/go-obscuro/integration/common" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/wallet" + testcommon "github.com/ten-protocol/go-ten/integration/common" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) // L1Config tells network admin how to setup the L1 network diff --git a/integration/simulation/devnetwork/dev_network.go b/integration/simulation/devnetwork/dev_network.go index 3a2fe89189..462bc26feb 100644 --- a/integration/simulation/devnetwork/dev_network.go +++ b/integration/simulation/devnetwork/dev_network.go @@ -7,22 +7,22 @@ import ( "sync" "time" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/simulation/network" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/integration/networktest/userwallet" + "github.com/ten-protocol/go-ten/integration/networktest/userwallet" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/networktest" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/networktest" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) var _defaultFaucetAmount = big.NewInt(750_000_000_000_000) @@ -54,6 +54,10 @@ type InMemDevNetwork struct { faucetLock sync.Mutex } +func (s *InMemDevNetwork) GetMCOwnerWallet() (wallet.Wallet, error) { + return s.networkWallets.MCOwnerWallet, nil +} + func (s *InMemDevNetwork) ChainID() int64 { return integration.ObscuroChainID } diff --git a/integration/simulation/devnetwork/geth_l1.go b/integration/simulation/devnetwork/geth_l1.go index 1a0f4c3a7b..3de0028ffd 100644 --- a/integration/simulation/devnetwork/geth_l1.go +++ b/integration/simulation/devnetwork/geth_l1.go @@ -3,12 +3,12 @@ package devnetwork import ( "fmt" - "github.com/obscuronet/go-obscuro/integration" + "github.com/ten-protocol/go-ten/integration" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/integration/eth2network" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/integration/eth2network" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) type gethDockerNetwork struct { diff --git a/integration/simulation/devnetwork/l1_network.go b/integration/simulation/devnetwork/l1_network.go index 910e38c17f..79f77b8f41 100644 --- a/integration/simulation/devnetwork/l1_network.go +++ b/integration/simulation/devnetwork/l1_network.go @@ -1,7 +1,7 @@ package devnetwork import ( - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" ) // L1Network represents the L1Network being used for the devnetwork diff --git a/integration/simulation/devnetwork/live_l1.go b/integration/simulation/devnetwork/live_l1.go index 33f3e89122..d5ad085e21 100644 --- a/integration/simulation/devnetwork/live_l1.go +++ b/integration/simulation/devnetwork/live_l1.go @@ -5,9 +5,9 @@ import ( "time" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/common/testlog" ) type liveL1Network struct { diff --git a/integration/simulation/devnetwork/node.go b/integration/simulation/devnetwork/node.go index 771d63061f..071d2eb425 100644 --- a/integration/simulation/devnetwork/node.go +++ b/integration/simulation/devnetwork/node.go @@ -7,30 +7,30 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/host/l1" + "github.com/ten-protocol/go-ten/go/host/l1" - "github.com/obscuronet/go-obscuro/go/host" + "github.com/ten-protocol/go-ten/go/host" - "github.com/obscuronet/go-obscuro/go/enclave/storage/init/sqlite" + "github.com/ten-protocol/go-ten/go/enclave/storage/init/sqlite" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/metrics" - "github.com/obscuronet/go-obscuro/go/config" - enclavecontainer "github.com/obscuronet/go-obscuro/go/enclave/container" - "github.com/obscuronet/go-obscuro/go/ethadapter" - hostcontainer "github.com/obscuronet/go-obscuro/go/host/container" - "github.com/obscuronet/go-obscuro/go/host/p2p" - "github.com/obscuronet/go-obscuro/go/host/rpc/clientrpc" - "github.com/obscuronet/go-obscuro/go/host/rpc/enclaverpc" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/metrics" + "github.com/ten-protocol/go-ten/go/config" + enclavecontainer "github.com/ten-protocol/go-ten/go/enclave/container" + "github.com/ten-protocol/go-ten/go/ethadapter" + hostcontainer "github.com/ten-protocol/go-ten/go/host/container" + "github.com/ten-protocol/go-ten/go/host/p2p" + "github.com/ten-protocol/go-ten/go/host/rpc/clientrpc" + "github.com/ten-protocol/go-ten/go/host/rpc/enclaverpc" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) // InMemNodeOperator represents an Obscuro node playing a role in a DevSimulation diff --git a/integration/simulation/network/geth_network.go b/integration/simulation/network/geth_network.go index b34432a196..6b2eb9a30e 100644 --- a/integration/simulation/network/geth_network.go +++ b/integration/simulation/network/geth_network.go @@ -1,15 +1,15 @@ package network import ( - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/erc20contractlib" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/eth2network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/erc20contractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/eth2network" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/stats" ) type networkInMemGeth struct { diff --git a/integration/simulation/network/geth_utils.go b/integration/simulation/network/geth_utils.go index 98bc58c920..4ab51389a7 100644 --- a/integration/simulation/network/geth_utils.go +++ b/integration/simulation/network/geth_utils.go @@ -9,15 +9,15 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" - "github.com/obscuronet/go-obscuro/go/common/constants" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/erc20contract" - "github.com/obscuronet/go-obscuro/integration/eth2network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" + "github.com/ten-protocol/go-ten/go/common/constants" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/erc20contract" + "github.com/ten-protocol/go-ten/integration/eth2network" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) const ( diff --git a/integration/simulation/network/inmemory.go b/integration/simulation/network/inmemory.go index d5a15cf22f..12c37f4d7b 100644 --- a/integration/simulation/network/inmemory.go +++ b/integration/simulation/network/inmemory.go @@ -4,17 +4,17 @@ import ( "time" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/host/container" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - testcommon "github.com/obscuronet/go-obscuro/integration/common" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/p2p" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/host/container" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + testcommon "github.com/ten-protocol/go-ten/integration/common" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/p2p" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/stats" ) type basicNetworkOfInMemoryNodes struct { diff --git a/integration/simulation/network/network.go b/integration/simulation/network/network.go index c856fbf188..b1f05b0c11 100644 --- a/integration/simulation/network/network.go +++ b/integration/simulation/network/network.go @@ -3,16 +3,16 @@ package network import ( "math/rand" - "github.com/obscuronet/go-obscuro/go/rpc" + "github.com/ten-protocol/go-ten/go/rpc" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/obsclient" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/stats" ) // Network is responsible with knowing how to manage the lifecycle of networks of Ethereum or Obscuro nodes. diff --git a/integration/simulation/network/network_utils.go b/integration/simulation/network/network_utils.go index b755e26d8c..399ea5668d 100644 --- a/integration/simulation/network/network_utils.go +++ b/integration/simulation/network/network_utils.go @@ -6,28 +6,28 @@ import ( "math/big" "time" - "github.com/obscuronet/go-obscuro/go/host/l1" + "github.com/ten-protocol/go-ten/go/host/l1" - "github.com/obscuronet/go-obscuro/go/host" + "github.com/ten-protocol/go-ten/go/host" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/common/metrics" - "github.com/obscuronet/go-obscuro/go/config" - "github.com/obscuronet/go-obscuro/go/enclave" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/host/container" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/metrics" + "github.com/ten-protocol/go-ten/go/config" + "github.com/ten-protocol/go-ten/go/enclave" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/host/container" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/stats" gethcommon "github.com/ethereum/go-ethereum/common" - hostcommon "github.com/obscuronet/go-obscuro/go/common/host" - testcommon "github.com/obscuronet/go-obscuro/integration/common" + hostcommon "github.com/ten-protocol/go-ten/go/common/host" + testcommon "github.com/ten-protocol/go-ten/integration/common" ) const ( @@ -94,7 +94,7 @@ func createInMemObscuroNode( MaxBatchSize: 1024 * 25, MaxRollupSize: 1024 * 64, BaseFee: big.NewInt(1), // todo @siliev:: fix test transaction builders so this can be different - GasLimit: big.NewInt(1_000_000_000), + GasLimit: big.NewInt(1_000_000_000_000_000_000), } enclaveLogger := testlog.Logger().New(log.NodeIDKey, id, log.CmpKey, log.EnclaveCmp) diff --git a/integration/simulation/network/obscuro_node_utils.go b/integration/simulation/network/obscuro_node_utils.go index d28052f15f..33da3caaf6 100644 --- a/integration/simulation/network/obscuro_node_utils.go +++ b/integration/simulation/network/obscuro_node_utils.go @@ -7,20 +7,20 @@ import ( "strings" "time" - "github.com/obscuronet/go-obscuro/go/common/host" - "github.com/obscuronet/go-obscuro/go/ethadapter" - hostcontainer "github.com/obscuronet/go-obscuro/go/host/container" - "github.com/obscuronet/go-obscuro/integration/simulation/p2p" - - "github.com/obscuronet/go-obscuro/go/common/viewingkey" - - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/go/common/host" + "github.com/ten-protocol/go-ten/go/ethadapter" + hostcontainer "github.com/ten-protocol/go-ten/go/host/container" + "github.com/ten-protocol/go-ten/integration/simulation/p2p" + + "github.com/ten-protocol/go-ten/go/common/viewingkey" + + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/simulation/params" "golang.org/x/sync/errgroup" ) diff --git a/integration/simulation/network/socket.go b/integration/simulation/network/socket.go index 9784365802..874e5c8125 100644 --- a/integration/simulation/network/socket.go +++ b/integration/simulation/network/socket.go @@ -4,21 +4,21 @@ import ( "fmt" "time" - "github.com/obscuronet/go-obscuro/integration/noderunner" + "github.com/ten-protocol/go-ten/integration/noderunner" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/erc20contractlib" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/node" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/eth2network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/erc20contractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/node" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/eth2network" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/stats" ) // creates Obscuro nodes with their own enclave servers that communicate with peers via sockets, wires them up, and populates the network objects diff --git a/integration/simulation/output_stats.go b/integration/simulation/output_stats.go index e97a54d106..0d886d60e3 100644 --- a/integration/simulation/output_stats.go +++ b/integration/simulation/output_stats.go @@ -6,12 +6,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/integration/common/testlog" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // OutputStats decouples the processing of data and the collection of statistics diff --git a/integration/simulation/p2p/in_mem_obscuro_client.go b/integration/simulation/p2p/in_mem_obscuro_client.go index 1456d32422..d597832a88 100644 --- a/integration/simulation/p2p/in_mem_obscuro_client.go +++ b/integration/simulation/p2p/in_mem_obscuro_client.go @@ -9,17 +9,17 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/host/container" - "github.com/obscuronet/go-obscuro/go/host/rpc/clientapi" - "github.com/obscuronet/go-obscuro/go/responses" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/host/container" + "github.com/ten-protocol/go-ten/go/host/rpc/clientapi" + "github.com/ten-protocol/go-ten/go/responses" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/integration/common/testlog" gethcommon "github.com/ethereum/go-ethereum/common" gethrpc "github.com/ethereum/go-ethereum/rpc" - hostcommon "github.com/obscuronet/go-obscuro/go/common/host" + hostcommon "github.com/ten-protocol/go-ten/go/common/host" ) const ( diff --git a/integration/simulation/p2p/mock_l2_network.go b/integration/simulation/p2p/mock_l2_network.go index 6e47aa9f14..cc562e3c1b 100644 --- a/integration/simulation/p2p/mock_l2_network.go +++ b/integration/simulation/p2p/mock_l2_network.go @@ -6,14 +6,14 @@ import ( "sync/atomic" "time" - "github.com/obscuronet/go-obscuro/go/common/subscription" + "github.com/ten-protocol/go-ten/go/common/subscription" - "github.com/obscuronet/go-obscuro/go/common/async" + "github.com/ten-protocol/go-ten/go/common/async" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/host" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/host" - testcommon "github.com/obscuronet/go-obscuro/integration/common" + testcommon "github.com/ten-protocol/go-ten/integration/common" ) const _sequencerID = "0" diff --git a/integration/simulation/params/params.go b/integration/simulation/params/params.go index e550820b6a..05d43b1d1d 100644 --- a/integration/simulation/params/params.go +++ b/integration/simulation/params/params.go @@ -5,8 +5,8 @@ import ( "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/ethadapter/erc20contractlib" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/erc20contractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" ) // SimParams are the parameters for setting up the simulation. @@ -46,7 +46,7 @@ type L1SetupData struct { ObscuroStartBlock common.Hash // MgmtContractAddr defines the management contract address MgmtContractAddress common.Address - // ObxErc20Address - the address of the "OBX" ERC20 + // ObxErc20Address - the address of the "TEN" ERC20 ObxErc20Address common.Address // EthErc20Address - the address of the "ETH" ERC20 EthErc20Address common.Address diff --git a/integration/simulation/params/wallet_utils.go b/integration/simulation/params/wallet_utils.go index cd2b1d9ed7..12d36c392c 100644 --- a/integration/simulation/params/wallet_utils.go +++ b/integration/simulation/params/wallet_utils.go @@ -3,17 +3,17 @@ package params import ( "math/big" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/wallet" - testcommon "github.com/obscuronet/go-obscuro/integration/common" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/go/wallet" + testcommon "github.com/ten-protocol/go-ten/integration/common" + "github.com/ten-protocol/go-ten/integration/datagenerator" ) // SimToken - mapping between the ERC20s on Ethereum and Obscuro. This holds both the contract addresses and the keys of the contract owners, diff --git a/integration/simulation/simulation.go b/integration/simulation/simulation.go index f043655a57..a3d0d5f5d8 100644 --- a/integration/simulation/simulation.go +++ b/integration/simulation/simulation.go @@ -12,21 +12,21 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/filters" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/erc20contract" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" - "github.com/obscuronet/go-obscuro/integration/simulation/stats" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/erc20contract" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/stats" gethcommon "github.com/ethereum/go-ethereum/common" - testcommon "github.com/obscuronet/go-obscuro/integration/common" + testcommon "github.com/ten-protocol/go-ten/integration/common" ) const ( @@ -140,15 +140,13 @@ func (s *Simulation) bridgeFundingToObscuro() { gethcommon.HexToAddress("0xDEe530E22045939e6f6a0A593F829e35A140D3F1"), } - ethClient := s.RPCHandles.RndEthClient() - - busCtr, err := MessageBus.NewMessageBus(destAddr, ethClient.EthClient()) + busCtr, err := MessageBus.NewMessageBus(destAddr, s.RPCHandles.RndEthClient().EthClient()) if err != nil { panic(err) } - for idx, wallet := range wallets { - opts, err := bind.NewKeyedTransactorWithChainID(wallet.PrivateKey(), wallet.ChainID()) + for idx, w := range wallets { + opts, err := bind.NewKeyedTransactorWithChainID(w.PrivateKey(), w.ChainID()) if err != nil { panic(err) } @@ -160,7 +158,7 @@ func (s *Simulation) bridgeFundingToObscuro() { } } - time.Sleep(3 * time.Second) + time.Sleep(15 * time.Second) // todo - fix the wait group, for whatever reason it does not find a receipt... /*wg := sync.WaitGroup{} for _, tx := range transactions { @@ -232,6 +230,7 @@ func (s *Simulation) deployObscuroERC20s() { Gas: 1025_000_000, GasFeeCap: gethcommon.Big1, // This field is used to derive the gas price for dynamic fee transactions. Data: contractBytes, + GasTipCap: gethcommon.Big1, } signedTx, err := owner.SignTransaction(&deployContractTx) diff --git a/integration/simulation/simulation_full_network_test.go b/integration/simulation/simulation_full_network_test.go index c02c6f155e..3f56a64d66 100644 --- a/integration/simulation/simulation_full_network_test.go +++ b/integration/simulation/simulation_full_network_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration" + "github.com/ten-protocol/go-ten/integration" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/params" - "github.com/obscuronet/go-obscuro/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/network" ) // This test creates a network of L2 nodes, then injects transactions, and finally checks the resulting output blockchain. diff --git a/integration/simulation/simulation_geth_in_mem_test.go b/integration/simulation/simulation_geth_in_mem_test.go index 5c0f0ded68..4c59b81f04 100644 --- a/integration/simulation/simulation_geth_in_mem_test.go +++ b/integration/simulation/simulation_geth_in_mem_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration" + "github.com/ten-protocol/go-ten/integration" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) const gethTestEnv = "GETH_TEST_ENABLED" diff --git a/integration/simulation/simulation_in_mem_test.go b/integration/simulation/simulation_in_mem_test.go index 051dee8c1b..c776360021 100644 --- a/integration/simulation/simulation_in_mem_test.go +++ b/integration/simulation/simulation_in_mem_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/ethereummock" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" ) // This test creates a network of in memory L1 and L2 nodes, then injects transactions, and finally checks the resulting output blockchain. diff --git a/integration/simulation/simulation_tester.go b/integration/simulation/simulation_tester.go index 7179e24477..4d4e837998 100644 --- a/integration/simulation/simulation_tester.go +++ b/integration/simulation/simulation_tester.go @@ -7,15 +7,15 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" - simstats "github.com/obscuronet/go-obscuro/integration/simulation/stats" + simstats "github.com/ten-protocol/go-ten/integration/simulation/stats" "github.com/google/uuid" ) diff --git a/integration/simulation/stats/stats.go b/integration/simulation/stats/stats.go index cd471c915f..8e63970816 100644 --- a/integration/simulation/stats/stats.go +++ b/integration/simulation/stats/stats.go @@ -7,7 +7,7 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) // Stats - collects information during the simulation. It can be checked programmatically. diff --git a/integration/simulation/transaction_injector.go b/integration/simulation/transaction_injector.go index 8b4c44a49e..497470a86c 100644 --- a/integration/simulation/transaction_injector.go +++ b/integration/simulation/transaction_injector.go @@ -12,24 +12,24 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/ethadapter/erc20contractlib" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/integration/simulation/network" - "github.com/obscuronet/go-obscuro/integration/simulation/params" + "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/ethadapter/erc20contractlib" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/params" "golang.org/x/sync/errgroup" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" - testcommon "github.com/obscuronet/go-obscuro/integration/common" - simstats "github.com/obscuronet/go-obscuro/integration/simulation/stats" + testcommon "github.com/ten-protocol/go-ten/integration/common" + simstats "github.com/ten-protocol/go-ten/integration/simulation/stats" ) const ( diff --git a/integration/simulation/transaction_injector_tracker.go b/integration/simulation/transaction_injector_tracker.go index 70eafdcfc1..b0fe77dab5 100644 --- a/integration/simulation/transaction_injector_tracker.go +++ b/integration/simulation/transaction_injector_tracker.go @@ -4,10 +4,10 @@ import ( "sync" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" ) type txInjectorTracker struct { diff --git a/integration/simulation/utils.go b/integration/simulation/utils.go index f0047ce0d9..e90ab18b0d 100644 --- a/integration/simulation/utils.go +++ b/integration/simulation/utils.go @@ -7,17 +7,17 @@ import ( "time" "github.com/ethereum/go-ethereum" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/obsclient" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" - testcommon "github.com/obscuronet/go-obscuro/integration/common" + testcommon "github.com/ten-protocol/go-ten/integration/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/ethadapter/erc20contractlib" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/ethadapter/erc20contractlib" ) const ( diff --git a/integration/simulation/validate_chain.go b/integration/simulation/validate_chain.go index ce2b1983ee..3f5db642ea 100644 --- a/integration/simulation/validate_chain.go +++ b/integration/simulation/validate_chain.go @@ -10,30 +10,30 @@ import ( "testing" "time" - "github.com/obscuronet/go-obscuro/contracts/generated/MessageBus" + "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" - testcommon "github.com/obscuronet/go-obscuro/integration/common" - "github.com/obscuronet/go-obscuro/integration/ethereummock" + testcommon "github.com/ten-protocol/go-ten/integration/common" + "github.com/ten-protocol/go-ten/integration/ethereummock" - "github.com/obscuronet/go-obscuro/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/common/testlog" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/obsclient" - "github.com/obscuronet/go-obscuro/integration/simulation/network" + "github.com/ten-protocol/go-ten/integration/simulation/network" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/go/rpc" + "github.com/ten-protocol/go-ten/go/rpc" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/core/types" gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/obscuronet/go-obscuro/go/common" + "github.com/ten-protocol/go-ten/go/common" - erc20 "github.com/obscuronet/go-obscuro/integration/erc20contract/generated/EthERC20" + erc20 "github.com/ten-protocol/go-ten/integration/erc20contract/generated/EthERC20" ) const ( diff --git a/integration/smartcontract/debug_mgmt_contract_lib.go b/integration/smartcontract/debug_mgmt_contract_lib.go index b1f0f21909..6a3245d8a7 100644 --- a/integration/smartcontract/debug_mgmt_contract_lib.go +++ b/integration/smartcontract/debug_mgmt_contract_lib.go @@ -4,12 +4,12 @@ import ( "bytes" "fmt" - generatedManagementContract "github.com/obscuronet/go-obscuro/contracts/generated/ManagementContract" + generatedManagementContract "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" gethcommon "github.com/ethereum/go-ethereum/common" ethereumclient "github.com/ethereum/go-ethereum/ethclient" diff --git a/integration/smartcontract/debug_wallet.go b/integration/smartcontract/debug_wallet.go index 55e3c26205..57c68f3002 100644 --- a/integration/smartcontract/debug_wallet.go +++ b/integration/smartcontract/debug_wallet.go @@ -8,8 +8,8 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/wallet" ) var _timeout = 30 * time.Second diff --git a/integration/smartcontract/pk_test.go b/integration/smartcontract/pk_test.go index 47f06618f3..c6ae24a3d7 100644 --- a/integration/smartcontract/pk_test.go +++ b/integration/smartcontract/pk_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/datagenerator" ) func TestSign(t *testing.T) { diff --git a/integration/smartcontract/smartcontracts_test.go b/integration/smartcontract/smartcontracts_test.go index a4c3abaee0..1f04054db7 100644 --- a/integration/smartcontract/smartcontracts_test.go +++ b/integration/smartcontract/smartcontracts_test.go @@ -9,17 +9,17 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/constants" - "github.com/obscuronet/go-obscuro/go/ethadapter" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" - "github.com/obscuronet/go-obscuro/integration/eth2network" - "github.com/obscuronet/go-obscuro/integration/simulation/network" "github.com/stretchr/testify/assert" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/constants" + "github.com/ten-protocol/go-ten/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" + "github.com/ten-protocol/go-ten/integration/eth2network" + "github.com/ten-protocol/go-ten/integration/simulation/network" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/planning/Testnet release plan.md b/planning/Testnet release plan.md index abf6fe56e2..40fedda06e 100644 --- a/planning/Testnet release plan.md +++ b/planning/Testnet release plan.md @@ -24,7 +24,7 @@ Note that there is no protocol work listed here. These are the tasks that are or d) Try outside of Azure? 2. Design and implement reveleation period 3. Finalise cryptography - a) key derivation (both the obscuro network key, and the symmetric rollup encryption keys) + a) key derivation (both the ten network key, and the symmetric rollup encryption keys) b) Calculate hashes on startup c) Check that the rollup producer is attested d) Add entropy to txs diff --git a/planning/testnet-kpis.md b/planning/testnet-kpis.md index 807a5385f4..d785c01385 100644 --- a/planning/testnet-kpis.md +++ b/planning/testnet-kpis.md @@ -1,8 +1,8 @@ # Measuring Testnet Success -The launch of a testnet in Web3 is a significant milestone for all projects. It demonstrates the capability of the solution, whether the project is likely to meet the promises shared with investors and with the community and it signifies a confident step towards mainnet. The final iterations of a testnet should very closely emulate mainnet and give assurances to users, developers and investors that the final product will be of a high quality with a high chance of success. As a result, the impression left by testnet is crucial to the expected success of a project and how it is perceived. The primary contributors of success for Obscuro testnet are whether it is attractive, it is being used and whether or not users have a positive experience with it. Making the degree of success quantifiable means defining mesaurable success criteria and collecting data to know whether those criteria are being met. +The launch of a testnet in Web3 is a significant milestone for all projects. It demonstrates the capability of the solution, whether the project is likely to meet the promises shared with investors and with the community and it signifies a confident step towards mainnet. The final iterations of a testnet should very closely emulate mainnet and give assurances to users, developers and investors that the final product will be of a high quality with a high chance of success. As a result, the impression left by testnet is crucial to the expected success of a project and how it is perceived. The primary contributors of success for Ten testnet are whether it is attractive, it is being used and whether or not users have a positive experience with it. Making the degree of success quantifiable means defining mesaurable success criteria and collecting data to know whether those criteria are being met. ## Testnet Success Criteria -Determining success for testnet will be a data-driven exercise, this being the best way to make measurable and repeatable observations. These observations can subsquently feed into decision-making with outcomes again being measured and compared. Included in the measurements will be criteria which, on the face of it, do not provide value however they have gained traction in the Web3 communicty as success indicators by which projects are judged. We need commentators to be able to compare Obscuro to other projects using like-for-like data points which the Web3 community are comfortable with even if they offer little value, or can even be misleading. For example, total number of transactions in a given period of time is a data point commonly used to compare projects yet it can be easily gamed. +Determining success for testnet will be a data-driven exercise, this being the best way to make measurable and repeatable observations. These observations can subsquently feed into decision-making with outcomes again being measured and compared. Included in the measurements will be criteria which, on the face of it, do not provide value however they have gained traction in the Web3 communicty as success indicators by which projects are judged. We need commentators to be able to compare Ten to other projects using like-for-like data points which the Web3 community are comfortable with even if they offer little value, or can even be misleading. For example, total number of transactions in a given period of time is a data point commonly used to compare projects yet it can be easily gamed. The testnet success critera have been expressed below in the form of Key Performance Indicators with the rationale for their inclusion, the data source, the actual metric and the target value. ## Testnet KPIs @@ -11,8 +11,8 @@ Key performance indicators (KPIs) will be used to determine the amount of Testne ### Selected KPIs for Users | KPI NAME | RATIONALE | SOURCE | METRIC | TARGET | |--|--|--|--|--| -| Testnet uptime | Captures how robust and ready for mainnet Obscuro is | DataDog avg:system.uptime{*} | Average Testnet uptime over the last 4 weeks|99.9%| -| Number of wallets connected to Obscuro Gateway| Good proxy for the number of active users. Straightforward to capture.| Datadog? |Number of daily connections|500| +| Testnet uptime | Captures how robust and ready for mainnet Ten is | DataDog avg:system.uptime{*} | Average Testnet uptime over the last 4 weeks|99.9%| +| Number of wallets connected to Ten Gateway| Good proxy for the number of active users. Straightforward to capture.| Datadog? |Number of daily connections|500| | Number of transactions| Typical guage of the amount of activity on testnet (even though it can be gamed).| Datadog? |Number of daily transactions|2000| | Number of RPC requests| Alternative guage of the amount of activity on testnet. Can also show where RPC performance degrades.| Datadog? |Number of daily RPC requests|2000| @@ -21,7 +21,7 @@ Key performance indicators (KPIs) will be used to determine the amount of Testne |--|--|--|--|--| | Testnet documentation page views (https://docs.obscu.ro/testnet/) | Gauges interest from developers in building on testnet. A good early indicator. Straightforward to capture | Google Analytics | Number of unique page views in the last 4 weeks |50| |DApps in development| This is difficult to measure as it’s not something we can look to the network to accurately measure. We can use our business development CRM data as an indicator. | Airtable "Partnerships" tab| Number of partners with status changed to "Soft Commitment" in the last 4 weeks|40| -| New dApps deployed on Testnet| Indicates how much new activity and commitment of effort from dApp builders| ObscuroScan?| Number of new dApp addresses deployed in the last 4 weeks|20| +| New dApps deployed on Testnet| Indicates how much new activity and commitment of effort from dApp builders| TenScan?| Number of new dApp addresses deployed in the last 4 weeks|20| ## Discounted KPIs These KPIs were considered and discounted for now. @@ -29,17 +29,17 @@ These KPIs were considered and discounted for now. - Wallet extension downloads - Good proxy for the number of active users. - Straightforward to capture. - - Discounted because Obscuro Gateway is the recommended wallet connection method. + - Discounted because Ten Gateway is the recommended wallet connection method. - Ported Solidity dApps– original vs fork - - One of Obscuro’s key promises is that existing Solidity dApps will just work on Obscuro. This KPI helps track whether Obscuro is fulfilling this promise. The reason for differentiating between original fork e.g. Uniswap vs PancakeSwap is it further provides insight into whether original teams believe in Obscuro. + - One of Ten’s key promises is that existing Solidity dApps will just work on Ten. This KPI helps track whether Ten is fulfilling this promise. The reason for differentiating between original fork e.g. Uniswap vs PancakeSwap is it further provides insight into whether original teams believe in Ten. - Discounted because very difficult to determine of the dApps on Testnet which have been ported. - Number of nodes - - Nodes secure the network and track general interest in Obscuro. This KPI also provides an input into the staking function and has an impact on tokenomics. - - Discounted for now because Obscuro Labs will run the nodes. When validator nodes can be run by others, this KPI will be introduced. + - Nodes secure the network and track general interest in Ten. This KPI also provides an input into the staking function and has an impact on tokenomics. + - Discounted for now because Ten Labs will run the nodes. When validator nodes can be run by others, this KPI will be introduced. - Faucet requests - Tracks the number of tokens being requested and whether users are coming back for more. Straightforward to capture. - Discounted because it can be gamed too easily leading to misleading results. - Number of organisations building on Testnet - - Funded organisations building on Obscuro vs individuals. Good indicator of the long-term health of dApps being built on Obscuro and expands on number of new dApps. + - Funded organisations building on Ten vs individuals. Good indicator of the long-term health of dApps being built on Ten and expands on number of new dApps. - Discounted because large effort required to determine who is building on Testnet. diff --git a/pull_request_template.md b/pull_request_template.md index 08b7347b07..8b651e3edd 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -9,7 +9,7 @@ Please provide a high level list of the changes made ### PR checks pre-merging Please indicate below by ticking the checkbox that you have read and performed the required -[PR checks](https://github.com/obscuronet/obscuro-internal/blob/main/dev-ops-docs/dev-pr-checks.md) +[PR checks](https://github.com/ten-protocol/ten-internal/blob/main/dev-ops-docs/dev-pr-checks.md) - [ ] PR checks reviewed and performed diff --git a/testnet/launcher/cmd/main.go b/testnet/launcher/cmd/main.go index fb8cdc3713..4671e6a289 100644 --- a/testnet/launcher/cmd/main.go +++ b/testnet/launcher/cmd/main.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/obscuronet/go-obscuro/testnet/launcher" + "github.com/ten-protocol/go-ten/testnet/launcher" ) func main() { diff --git a/testnet/launcher/docker.go b/testnet/launcher/docker.go index b00033ff76..4cc96560eb 100644 --- a/testnet/launcher/docker.go +++ b/testnet/launcher/docker.go @@ -4,15 +4,15 @@ import ( "fmt" "time" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/node" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/testnet/launcher/eth2network" "github.com/sanity-io/litter" - - l1cd "github.com/obscuronet/go-obscuro/testnet/launcher/l1contractdeployer" - l2cd "github.com/obscuronet/go-obscuro/testnet/launcher/l2contractdeployer" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/node" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/testnet/launcher/eth2network" + + l1cd "github.com/ten-protocol/go-ten/testnet/launcher/l1contractdeployer" + l2cd "github.com/ten-protocol/go-ten/testnet/launcher/l2contractdeployer" ) type Testnet struct { diff --git a/testnet/launcher/eth2network/docker.go b/testnet/launcher/eth2network/docker.go index 2a5443077f..65685833f5 100644 --- a/testnet/launcher/eth2network/docker.go +++ b/testnet/launcher/eth2network/docker.go @@ -7,9 +7,9 @@ import ( "time" "github.com/ethereum/go-ethereum/ethclient" - "github.com/obscuronet/go-obscuro/go/common/docker" - "github.com/obscuronet/go-obscuro/go/common/retry" "github.com/sanity-io/litter" + "github.com/ten-protocol/go-ten/go/common/docker" + "github.com/ten-protocol/go-ten/go/common/retry" ) type Eth2Network struct { diff --git a/testnet/launcher/fundsrecovery/cmd/main.go b/testnet/launcher/fundsrecovery/cmd/main.go index 9c93e85bc7..560ddf3cf5 100644 --- a/testnet/launcher/fundsrecovery/cmd/main.go +++ b/testnet/launcher/fundsrecovery/cmd/main.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - funds "github.com/obscuronet/go-obscuro/testnet/launcher/fundsrecovery" + funds "github.com/ten-protocol/go-ten/testnet/launcher/fundsrecovery" ) func main() { diff --git a/testnet/launcher/fundsrecovery/docker.go b/testnet/launcher/fundsrecovery/docker.go index 5db43576a8..c6211807a4 100644 --- a/testnet/launcher/fundsrecovery/docker.go +++ b/testnet/launcher/fundsrecovery/docker.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" - "github.com/obscuronet/go-obscuro/go/common/docker" "github.com/sanity-io/litter" + "github.com/ten-protocol/go-ten/go/common/docker" ) type FundsRecovery struct { diff --git a/testnet/launcher/l1contractdeployer/cmd/main.go b/testnet/launcher/l1contractdeployer/cmd/main.go index 7b83350358..2446ea5a13 100644 --- a/testnet/launcher/l1contractdeployer/cmd/main.go +++ b/testnet/launcher/l1contractdeployer/cmd/main.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - l1cd "github.com/obscuronet/go-obscuro/testnet/launcher/l1contractdeployer" + l1cd "github.com/ten-protocol/go-ten/testnet/launcher/l1contractdeployer" ) func main() { diff --git a/testnet/launcher/l1contractdeployer/docker.go b/testnet/launcher/l1contractdeployer/docker.go index 9e4dc266e6..5ffedda3a1 100644 --- a/testnet/launcher/l1contractdeployer/docker.go +++ b/testnet/launcher/l1contractdeployer/docker.go @@ -9,12 +9,12 @@ import ( "strings" "time" - "github.com/obscuronet/go-obscuro/go/node" "github.com/sanity-io/litter" + "github.com/ten-protocol/go-ten/go/node" "github.com/docker/docker/api/types" "github.com/docker/docker/client" - "github.com/obscuronet/go-obscuro/go/common/docker" + "github.com/ten-protocol/go-ten/go/common/docker" ) type ContractDeployer struct { diff --git a/testnet/launcher/l2contractdeployer/cmd/main.go b/testnet/launcher/l2contractdeployer/cmd/main.go index 0bd586072d..7c926d155e 100644 --- a/testnet/launcher/l2contractdeployer/cmd/main.go +++ b/testnet/launcher/l2contractdeployer/cmd/main.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - l2cd "github.com/obscuronet/go-obscuro/testnet/launcher/l2contractdeployer" + l2cd "github.com/ten-protocol/go-ten/testnet/launcher/l2contractdeployer" ) func main() { diff --git a/testnet/launcher/l2contractdeployer/docker.go b/testnet/launcher/l2contractdeployer/docker.go index 564430a067..43963bd150 100644 --- a/testnet/launcher/l2contractdeployer/docker.go +++ b/testnet/launcher/l2contractdeployer/docker.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" - "github.com/obscuronet/go-obscuro/go/common/docker" "github.com/sanity-io/litter" + "github.com/ten-protocol/go-ten/go/common/docker" ) type ContractDeployer struct { diff --git a/tools/accountgen/main.go b/tools/accountgen/main.go index 0d1351fc1e..316e96aba1 100644 --- a/tools/accountgen/main.go +++ b/tools/accountgen/main.go @@ -4,9 +4,9 @@ import ( "encoding/hex" "fmt" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/common/testlog" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/common/testlog" + "github.com/ten-protocol/go-ten/integration/datagenerator" ) // Noddy tool to generate and test account PKs for manual testing etc. diff --git a/tools/faucet/README.md b/tools/faucet/README.md index 1bc7e8a2bb..e2bf4994d6 100644 --- a/tools/faucet/README.md +++ b/tools/faucet/README.md @@ -1,7 +1,7 @@ -# Obscuro Faucet +# Ten Faucet -This tools contains a Faucet to allow allocation of ETH tokens within an Obscuro network. For more information -on Obscuro see the [Obscuro repo](https://github.com/obscuronet/go-obscuro) and [documentation](https://docs.obscu.ro/). +This tools contains a Faucet to allow allocation of ETH tokens within an Ten network. For more information +on Ten see the [Ten repo](https://github.com/ten-protocol/go-ten) and [documentation](https://docs.obscu.ro/). ## Repository Structure The top level structure of the tool is as below; @@ -24,9 +24,9 @@ To run a local container and run the Faucet use the below; $ ./container_run.sh ``` -By default, when running locally the Faucet will connect to a local testnet started as described in the go-obscuro -project repo [readme](https://github.com/obscuronet/go-obscuro#building-and-running-a-local-testnet). It will connect -to the Obscuro node running within the local testnet on host `validator-host` and port `13010`. The Faucet opens +By default, when running locally the Faucet will connect to a local testnet started as described in the go-ten +project repo [readme](https://github.com/ten-protocol/go-ten#building-and-running-a-local-testnet). It will connect +to the Ten node running within the local testnet on host `validator-host` and port `13010`. The Faucet opens on port `80` within the container, but maps port `8080` on the host machine to this. diff --git a/tools/faucet/cmd/cli.go b/tools/faucet/cmd/cli.go index 640a957aec..5f8832b29c 100644 --- a/tools/faucet/cmd/cli.go +++ b/tools/faucet/cmd/cli.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/params" - "github.com/obscuronet/go-obscuro/tools/faucet/faucet" + "github.com/ten-protocol/go-ten/tools/faucet/faucet" ) const ( diff --git a/tools/faucet/cmd/main.go b/tools/faucet/cmd/main.go index 91c21ce887..b865ceba1b 100644 --- a/tools/faucet/cmd/main.go +++ b/tools/faucet/cmd/main.go @@ -6,7 +6,7 @@ import ( "os/signal" "syscall" - "github.com/obscuronet/go-obscuro/tools/faucet/container" + "github.com/ten-protocol/go-ten/tools/faucet/container" ) // local execution: PORT=80 go run . --nodeHost 127.0.0.1 --pk 0x8dfb8083da6275ae3e4f41e3e8a8c19d028d32c9247e24530933782f2a05035b --jwtSecret This_is_the_secret diff --git a/tools/faucet/container/faucet_container.go b/tools/faucet/container/faucet_container.go index 78718fcf16..d94be7502d 100644 --- a/tools/faucet/container/faucet_container.go +++ b/tools/faucet/container/faucet_container.go @@ -3,8 +3,8 @@ package container import ( "fmt" - "github.com/obscuronet/go-obscuro/tools/faucet/faucet" - "github.com/obscuronet/go-obscuro/tools/faucet/webserver" + "github.com/ten-protocol/go-ten/tools/faucet/faucet" + "github.com/ten-protocol/go-ten/tools/faucet/webserver" ) type FaucetContainer struct { diff --git a/tools/faucet/faucet/faucet.go b/tools/faucet/faucet/faucet.go index a0da725431..2da6f4205a 100644 --- a/tools/faucet/faucet/faucet.go +++ b/tools/faucet/faucet/faucet.go @@ -13,16 +13,16 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/go/wallet" ) const ( _timeout = 60 * time.Second NativeToken = "eth" - // DeprecatedNativeToken is left in temporarily for tooling that is getting native funds using `/obx` URL - DeprecatedNativeToken = "obx" // todo (@matt) remove this once we have fixed the /obx usages + // DeprecatedNativeToken is left in temporarily for tooling that is getting native funds using `/ten` URL + DeprecatedNativeToken = "ten" // todo (@matt) remove this once we have fixed the /ten usages WrappedOBX = "wobx" WrappedEth = "weth" WrappedUSDC = "usdc" @@ -51,34 +51,33 @@ func NewFaucet(rpcURL string, chainID int64, pkString string) (*Faucet, error) { }, nil } -func (f *Faucet) Fund(address *common.Address, token string, amount *big.Int) error { +func (f *Faucet) Fund(address *common.Address, token string, amount *big.Int) (string, error) { var err error var signedTx *types.Transaction if token == NativeToken || token == DeprecatedNativeToken { signedTx, err = f.fundNativeToken(address, amount) } else { - return fmt.Errorf("token not fundable atm") - // signedTx, err = f.fundERC20Token(address, token) + return "", fmt.Errorf("token not fundable atm") // todo implement this when contracts are deployable somewhere } if err != nil { - return err + return "", err } // the faucet should be the only user of the faucet pk txMarshal, err := json.Marshal(signedTx) if err != nil { - return err + return "", err } f.Logger.Info(fmt.Sprintf("Funded address: %s - tx: %+v\n", address.Hex(), string(txMarshal))) // todo handle tx receipt if err := f.validateTx(signedTx); err != nil { - return fmt.Errorf("unable to validate tx %s: %w", signedTx.Hash(), err) + return "", fmt.Errorf("unable to validate tx %s: %w", signedTx.Hash(), err) } - return nil + return signedTx.Hash().Hex(), nil } func (f *Faucet) validateTx(tx *types.Transaction) error { diff --git a/tools/faucet/webserver/web_server.go b/tools/faucet/webserver/web_server.go index 77b944b763..542024b68a 100644 --- a/tools/faucet/webserver/web_server.go +++ b/tools/faucet/webserver/web_server.go @@ -11,7 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/gin-gonic/gin" - "github.com/obscuronet/go-obscuro/tools/faucet/faucet" + "github.com/ten-protocol/go-ten/tools/faucet/faucet" ) type WebServer struct { @@ -118,7 +118,7 @@ func fundingHandler(faucetServer *faucet.Faucet, defaultAmount *big.Int) gin.Han switch tokenReq { case faucet.NativeToken: token = faucet.NativeToken - // we leave this option in temporarily for tools that are still using `/obx` endpoint for native funds + // we leave this option in temporarily for tools that are still using `/ten` endpoint for native funds case faucet.DeprecatedNativeToken: token = faucet.NativeToken case faucet.WrappedOBX: @@ -147,12 +147,13 @@ func fundingHandler(faucetServer *faucet.Faucet, defaultAmount *big.Int) gin.Han // fund the address addr := common.HexToAddress(req.Address) - if err := faucetServer.Fund(&addr, token, defaultAmount); err != nil { + hash, err := faucetServer.Fund(&addr, token, defaultAmount) + if err != nil { errorHandler(c, fmt.Errorf("unable to fund request %w", err), faucetServer.Logger) return } - c.JSON(http.StatusOK, gin.H{"status": "ok"}) + c.JSON(http.StatusOK, gin.H{"status": "ok", "tx": hash}) } } diff --git a/tools/gateway-js/gateway-lib/README.md b/tools/gateway-js/gateway-lib/README.md index d22b51c6a4..10bdce0ff5 100644 --- a/tools/gateway-js/gateway-lib/README.md +++ b/tools/gateway-js/gateway-lib/README.md @@ -1,6 +1,6 @@ -# Obscuro Gateway JS +# Ten Gateway JS -A JavaScript library for the gateway, providing streamlined access and functionalities for interacting with the Obscuro network. +A JavaScript library for the gateway, providing streamlined access and functionalities for interacting with the Ten network. ## Table of Contents @@ -13,23 +13,23 @@ A JavaScript library for the gateway, providing streamlined access and functiona ## Features -- Seamless connection to Obscuro Network. +- Seamless connection to Ten Network. - Easy-to-use methods for joining and authenticating. - External consumption support through CDN or NPM. ## Installation -To install `obscuro-gateway-js`, use npm: +To install `ten-gateway-js`, use npm: \`\`\`bash -npm install obscuro-gateway-js +npm install ten-gateway-js \`\`\` ## Usage \`\`\`javascript -const Gateway = require('obscuro-gateway-js'); +const Gateway = require('ten-gateway-js'); const gateway = new Gateway(httpURL, wsURL, provider); await gateway.join(); @@ -51,7 +51,7 @@ For production: npm run build \`\`\` -The production build will be available for external consumption on GitHub Pages at `https://go-obscuro.github.io/obscuronet/gateway.bundle.js`. +The production build will be available for external consumption on GitHub Pages at `https://go-ten.github.io/tennet/gateway.bundle.js`. ## Contribute diff --git a/tools/hardhatdeployer/README.md b/tools/hardhatdeployer/README.md index 261ba7b081..1ab5a21cb6 100644 --- a/tools/hardhatdeployer/README.md +++ b/tools/hardhatdeployer/README.md @@ -1,6 +1,6 @@ # Contract deployer -Deploys contracts to both the obscuro network (L2) and eth network (L1) +Deploys contracts to both the ten network (L2) and eth network (L1) ## Usage @@ -8,7 +8,7 @@ All commands are executed by running `contractdeployer/main/main()`. Contract is a string value to select the contract bytecode to deploy, currently ERC20, and MGMT are supported: - `ERC20`: a standard ERC20 contract -- `MGMT`: the Obscuro L1 management contract +- `MGMT`: the Ten L1 management contract * Example arguments to deploy an L2 contract: diff --git a/tools/hardhatdeployer/contract_deployer.go b/tools/hardhatdeployer/contract_deployer.go index 0726454627..d9a5839e95 100644 --- a/tools/hardhatdeployer/contract_deployer.go +++ b/tools/hardhatdeployer/contract_deployer.go @@ -10,10 +10,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/go/common/constants" - "github.com/obscuronet/go-obscuro/go/common/retry" - "github.com/obscuronet/go-obscuro/go/wallet" - "github.com/obscuronet/go-obscuro/integration/erc20contract" + "github.com/ten-protocol/go-ten/go/common/constants" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/erc20contract" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/tools/hardhatdeployer/eth_deployer.go b/tools/hardhatdeployer/eth_deployer.go index 2cb15a708a..ca6b4ae37e 100644 --- a/tools/hardhatdeployer/eth_deployer.go +++ b/tools/hardhatdeployer/eth_deployer.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/obscuronet/go-obscuro/go/ethadapter" + "github.com/ten-protocol/go-ten/go/ethadapter" ) func prepareEthDeployer(cfg *Config, logger gethlog.Logger) (contractDeployerClient, error) { diff --git a/tools/hardhatdeployer/main/main.go b/tools/hardhatdeployer/main/main.go index 1eecfc3e24..5365f11f77 100644 --- a/tools/hardhatdeployer/main/main.go +++ b/tools/hardhatdeployer/main/main.go @@ -4,10 +4,10 @@ import ( "fmt" "time" - contractdeployer "github.com/obscuronet/go-obscuro/tools/hardhatdeployer" + contractdeployer "github.com/ten-protocol/go-ten/tools/hardhatdeployer" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" ) func main() { diff --git a/tools/hardhatdeployer/obscuro_deployer.go b/tools/hardhatdeployer/obscuro_deployer.go index 0dd8f78bf0..a3e4153e75 100644 --- a/tools/hardhatdeployer/obscuro_deployer.go +++ b/tools/hardhatdeployer/obscuro_deployer.go @@ -8,10 +8,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" - "github.com/obscuronet/go-obscuro/go/enclave/genesis" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/obsclient/clientutil" - "github.com/obscuronet/go-obscuro/go/wallet" + "github.com/ten-protocol/go-ten/go/enclave/genesis" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/obsclient/clientutil" + "github.com/ten-protocol/go-ten/go/wallet" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" diff --git a/tools/obscuroscan/README.md b/tools/obscuroscan/README.md index 016713c853..45ca80af22 100644 --- a/tools/obscuroscan/README.md +++ b/tools/obscuroscan/README.md @@ -1,4 +1,4 @@ -# Obscuroscan +# TenScan See the documentation [here](https://docs.obscu.ro/testnet/obscuroscan.html). diff --git a/tools/obscuroscan/main/main.go b/tools/obscuroscan/main/main.go index c0b1a5ac97..b7a17408df 100644 --- a/tools/obscuroscan/main/main.go +++ b/tools/obscuroscan/main/main.go @@ -4,9 +4,9 @@ import ( "fmt" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common/log" + "github.com/ten-protocol/go-ten/go/common/log" - "github.com/obscuronet/go-obscuro/tools/obscuroscan" + "github.com/ten-protocol/go-ten/tools/obscuroscan" ) func main() { diff --git a/tools/obscuroscan/obscuroscan.go b/tools/obscuroscan/obscuroscan.go index 118f469595..32c2d53b11 100644 --- a/tools/obscuroscan/obscuroscan.go +++ b/tools/obscuroscan/obscuroscan.go @@ -20,7 +20,7 @@ import ( "syscall" "time" - "github.com/obscuronet/go-obscuro/go/common/compression" + "github.com/ten-protocol/go-ten/go/common/compression" "github.com/edgelesssys/ego/enclave" "github.com/ethereum/go-ethereum/accounts/abi" @@ -28,13 +28,13 @@ import ( "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/httputil" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/go/ethadapter/mgmtcontractlib" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/httputil" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" ) const ( diff --git a/tools/obscuroscan/obscuroscan_test.go b/tools/obscuroscan/obscuroscan_test.go index c394118929..2ac4ea843d 100644 --- a/tools/obscuroscan/obscuroscan_test.go +++ b/tools/obscuroscan/obscuroscan_test.go @@ -8,14 +8,14 @@ import ( "net/http/httptest" "testing" - "github.com/obscuronet/go-obscuro/go/common/compression" + "github.com/ten-protocol/go-ten/go/common/compression" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/httputil" - "github.com/obscuronet/go-obscuro/go/enclave/core" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/integration/datagenerator" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/httputil" + "github.com/ten-protocol/go-ten/go/enclave/core" + "github.com/ten-protocol/go-ten/go/enclave/crypto" + "github.com/ten-protocol/go-ten/integration/datagenerator" ) func TestCanDecryptTxBlob(t *testing.T) { diff --git a/tools/obscuroscan_v2/backend/cmd/cli.go b/tools/obscuroscan_v2/backend/cmd/cli.go index 863876ff31..2adcc1ca68 100644 --- a/tools/obscuroscan_v2/backend/cmd/cli.go +++ b/tools/obscuroscan_v2/backend/cmd/cli.go @@ -3,7 +3,7 @@ package main import ( "flag" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend/config" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend/config" ) func parseCLIArgs() *config.Config { diff --git a/tools/obscuroscan_v2/backend/cmd/main.go b/tools/obscuroscan_v2/backend/cmd/main.go index bdcda2eb8c..7abddadab9 100644 --- a/tools/obscuroscan_v2/backend/cmd/main.go +++ b/tools/obscuroscan_v2/backend/cmd/main.go @@ -8,7 +8,7 @@ import ( "os/signal" "time" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend/container" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend/container" ) func main() { diff --git a/tools/obscuroscan_v2/backend/container/container.go b/tools/obscuroscan_v2/backend/container/container.go index 46bad11516..7aeac74be0 100644 --- a/tools/obscuroscan_v2/backend/container/container.go +++ b/tools/obscuroscan_v2/backend/container/container.go @@ -3,12 +3,12 @@ package container import ( "fmt" - "github.com/obscuronet/go-obscuro/go/common/log" - "github.com/obscuronet/go-obscuro/go/obsclient" - "github.com/obscuronet/go-obscuro/go/rpc" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend/config" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend/webserver" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/obsclient" + "github.com/ten-protocol/go-ten/go/rpc" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend/config" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend/webserver" gethlog "github.com/ethereum/go-ethereum/log" ) diff --git a/tools/obscuroscan_v2/backend/obscuroscan_backend.go b/tools/obscuroscan_v2/backend/obscuroscan_backend.go index d2df5cb46d..7c783d10c9 100644 --- a/tools/obscuroscan_v2/backend/obscuroscan_backend.go +++ b/tools/obscuroscan_v2/backend/obscuroscan_backend.go @@ -7,11 +7,11 @@ import ( "fmt" "github.com/ethereum/go-ethereum/rlp" - "github.com/obscuronet/go-obscuro/go/common/compression" - "github.com/obscuronet/go-obscuro/go/enclave/crypto" + "github.com/ten-protocol/go-ten/go/common/compression" + "github.com/ten-protocol/go-ten/go/enclave/crypto" - "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/obsclient" + "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/obsclient" gethcommon "github.com/ethereum/go-ethereum/common" ) diff --git a/tools/obscuroscan_v2/backend/webserver/webserver.go b/tools/obscuroscan_v2/backend/webserver/webserver.go index b4e437e734..627c3e774b 100644 --- a/tools/obscuroscan_v2/backend/webserver/webserver.go +++ b/tools/obscuroscan_v2/backend/webserver/webserver.go @@ -10,7 +10,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" - "github.com/obscuronet/go-obscuro/tools/obscuroscan_v2/backend" + "github.com/ten-protocol/go-ten/tools/obscuroscan_v2/backend" ) type WebServer struct { diff --git a/tools/obscuroscan_v2/frontend/index.html b/tools/obscuroscan_v2/frontend/index.html index da8420a917..789e32deb8 100644 --- a/tools/obscuroscan_v2/frontend/index.html +++ b/tools/obscuroscan_v2/frontend/index.html @@ -3,7 +3,7 @@ ObscuroScan - +