Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Merge staging into master #139

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open

Merge staging into master #139

wants to merge 55 commits into from

Conversation

altonen
Copy link
Contributor

@altonen altonen commented Nov 29, 2021

No description provided.

iljakuklic and others added 30 commits November 16, 2021 08:50
Add a compilation-time feature to shorten the block interval to
3 seconds. Intended mainly for testing.

Use the `--features short-block-time` switch to Cargo to enable.
runtime: Cargo feature to make block production faster and fix functional tests
Refactor staking-related queries to separate file
These tests take too long in debug mode, so decrease the number of
randomly generated inputs by factor of 16, which gives us 16 tests run
by default. This should be enough to cover all the interesting code
paths most of the time.
Instead of allowing the smart contract caller to define the AccountId
of the contract, fetch the value from the ChainExtension's runtime memory.

This allows the programmable pool to force the smart contract to only spend
its own funds.
When PP is constructing the final TX that spends the smart contract's
funds, save the outpoint hashes of the vins to a separate storage.

This indicates to the local node that the smart contract has spent
its funds and when it receives a TX trying to spend CallPPs of a given
smart contract, the outpoint hashes in the witness field can be queried
from this storage and if they are found, the TX is valid (or at least
the local node agrees with the TX and accepts it).
This allows the test framework to query UTXOs of the smart contract.
Prevent a contract from calling itself through the ChainExtension as
the smart contract already has capabilities of calling its own functions
even without the existence of the ChainExtension, makes it harder to
handle contract balances correctly and makes it very easy for the user
to shoot themselves in the foot by accidentally calling the function
that called into the ChainExtension, effectively resulting in infite
recursion (bounded by the amount of gas, obviously).

If this is found to be needed, the issue can be revisited.
If the UTXO transfer from contract to P2PK or contract succeeds,
zero the balance of the smart contract as the contract no longer
holds any funds.
Implement functional tests for PP and create assets directory
which contains all smart contract related files
Programmable pool functional tests
Make unlock_and_withdraw test deterministic
Add Dockerfile for mintlayer-core
royster57 and others added 23 commits November 22, 2021 16:37
Updated docs for node start-up, tokens, and transactions
staking functional tests: expect exception on testing failed transactions
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants