* fix allowed txs to be able to handle multiple txs for same from address (#4624)
* [HOTFIX] fix leader crosslink issue to not include old cross link in the propo… (#4629)
* fix leader crosslink issue to not include old cross link in the proposing block
* set higher epoch threshold for pending crosslinks to be added to proposing block
* delete old pending cross links
* delete when proposing
* delete when proposing
* delete when proposing
* delete when proposing
* minor logic change for the log
* minor logic change for the log
* minor logic change for the log
* minor logic change for the log
---------
Co-authored-by: Diego Nava <diego.nava77@hotmail.com>
* Fix for possible panic. (#4627)
* Fix, removed duplicated check.
---------
Co-authored-by: Gheis Mohammadi <Gheis.Mohammadi@gmail.com>
Co-authored-by: Diego Nava <diego.nava77@hotmail.com>
Co-authored-by: Konstantin <355847+Frozen@users.noreply.github.com>
* fix allowed txs to be able to handle multiple txs for same from address
* improve tx data checking for allowed txs
Co-authored-by: Diego Nava <8563843+diego1q2w@users.noreply.github.com>
---------
Co-authored-by: Diego Nava <8563843+diego1q2w@users.noreply.github.com>
* fix null snapshot issue in chain helper's state sync new functions
* add WriteHeaderNumber to writeHeadBlock
* improve CurrentBlockNumberto handle unsaved new pivot
* fix null response data for full state sync
* add log for zero task in state worker loop
* adjust full state sync request parameters, rename stage_state
* add full state stage to the list of stages in fast sync
* add RangeMode and ChainExecutionMode to handle execution of the stream sync stage
* fix block exists issue on stage_states in stream sync
* fix double insertion in stage states
* add count for state downloader to return number of tasks
* fix travis build issue by goimports
* switch to Full Sync on pivot block, fix checking nil length in HandleRequestError
* Cleanup and fix update pub keys.
* Skip the next leader if it doesn't sign blocks.
* Comment & constant.
* Updated with dev.
* Updated with latest dev.
* Cleanup
* add new functions to p2p stream client for sharing the full states
* remove extra comments, add bytes checking
* add client tests for new p2p stream client functions
* rename new client functions
* complete tests for new functions of p2p stream client
This [github document](https://help.github.com/articles/creating-a-pull-request/) provides some guidance on how to create a pull request in github.
## PR requirement
To pursue engineering excellence, we have insisted on the highest stardard on the quality of each PR.
To pursue engineering excellence, we have insisted on the highest standard for the quality of each PR.
* For each PR, please run [golint](https://github.com/golang/lint), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), to fix the basic issues/warnings.
* Make sure you understand [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/).
@ -21,12 +21,12 @@ To pursue engineering excellence, we have insisted on the highest stardard on th
The best practice is to reorder and squash your local commits before the PR submission to create an atomic and self-contained PR.
This [book chapter](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) provides detailed explanation and guidance on how to rewrite the local git history.
For exampple, a typical workflow is like the following.
For example, a typical workflow is like the following.
```bash
# assuming you are working on a fix of bug1, and use a local branch called "fixes_of_bug1".
git clone https://github.com/harmony-one/harmony
cd harmony
git clone https://github.com/woop-chain/woop
cd woop
# create a local branch to keep track of the origin/master
@ -47,27 +39,27 @@ For macOS, you can reference this [guide](http://tldrdevnotes.com/bash-upgrade-3
## Dev Environment
**Most repos from [harmony-one](https://github.com/harmony-one) assumes the GOPATH convention. More information [here](https://github.com/golang/go/wiki/GOPATH).**
**Most repos from [woop-chain](https://github.com/woop-chain) assumes the GOPATH convention. More information [here](https://github.com/golang/go/wiki/GOPATH).**
### First Install
Clone and set up all of the repos with the following set of commands:
Included in this repo is a Dockerfile that has a full harmony development environment and
Included in this repo is a Dockerfile that has a full woop development environment and
comes with emacs, vim, ag, tig and other creature comforts. Most importantly, it already has the go environment
with our C/C++ based library dependencies (`libbls` and `mcl`) set up correctly for you.
You can build the docker image for yourself with the following commands:
```bash
cd $(go env GOPATH)/src/github.com/harmony-one/harmony
cd $(go env GOPATH)/src/github.com/woop-chain/woop
make clean
docker build -t harmony .
docker build -t woop .
```
> If your build machine has an ARM-based chip, like Apple silicon (M1), the image is built for `linux/arm64` by default. To build for `x86_64`, apply the `--platform` arg like so:
> Learn more about the `--platform` arg and multi-CPU architecture support, [here](https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope) and [here](https://docs.docker.com/desktop/multi-arch/).
@ -97,26 +89,26 @@ docker build -t harmony .
Then you can start your docker container with the following command:
> Note that the harmony repo will be shared between your docker container and your host machine. However, everything else in the docker container will be ephemeral.
> Note that the woop repo will be shared between your docker container and your host machine. However, everything else in the docker container will be ephemeral.
If you need to open another shell, just do:
```bash
docker exec -it harmony /bin/bash
docker exec -it woop /bin/bash
```
Learn more about docker [here](https://docker-curriculum.com/).
## Build
The `make` command should automatically build the Harmony binary & all dependent libs.
The `make` command should automatically build the Woop binary & all dependent libs.
However, if you wish to bypass the Makefile, first export the build flags:
To keep things consistent, we have a docker image to run all tests. **These are the same tests ran on the pull request checks**.
Note that all testing docker container binds a couple of ports to the host machine for your convince. The ports are:
Note that all test Docker containers bind several ports to the host machine for your convenience. The ports are:
* `9500` - Shard 0 RPC for a validator
* `9501` - Shard 1 RPC for a validator
* `9599` - Shard 0 RPC for an explorer
@ -159,7 +151,7 @@ Note that all testing docker container binds a couple of ports to the host machi
* `9798` - Shard 1 Rosetta (for an explorer)
* `9899` - Shard 0 WS for an explorer
* `9898` - Shard 1 WS for an explorer
> This allows you to use curl, hmy CLI, postman, rosetta-cli, etc... on your host machine to play with or probe the localnet that was used for the test.
> This allows you to use curl, wiki CLI, postman, rosetta-cli, etc... on your host machine to play with or probe the localnet that was used for the test.
### Go tests
To run this test, do:
@ -174,8 +166,8 @@ To run this test, do:
make test-rpc
```
This test starts a localnet (within the Docker container), **ensures it reaches a consensus**, and runs a series of tests to ensure correct RPC behavior.
This test also acts as a preliminary integration test (more through tests are done on the testnets).
> The tests ran by this command can be found [here](https://github.com/harmony-one/harmony-test/tree/master/localnet).
This test also acts as a preliminary integration test (more thorough tests are done on the testnets).
> The tests ran by this command can be found [here](https://github.com/woop-chain/woop-test/tree/master/localnet).
If you wish to debug further with the localnet after the tests are done, open a new shell and run:
```bash
@ -183,9 +175,9 @@ make test-rpc-attach
```
> This will open a shell in the docker container that is running the Node API tests.
>
> Note that the docker container has the [Harmony CLI](https://docs.harmony.one/home/wallets/harmony-cli) on path,
> therefore you can use that to debug if needed. For example, one could do `hmy blockchain latest-headers` to check
> the current block height of localnet. Reference the documentation for the CLI [here](https://docs.harmony.one/home/wallets/harmony-cli)
> Note that the docker container has the [Woop CLI](https://docs.wikiwoop.com/home/wallets/woop-cli) on path,
> therefore you can use that to debug if needed. For example, one could do `wiki blockchain latest-headers` to check
> the current block height of localnet. Reference the documentation for the CLI [here](https://docs.wikiwoop.com/home/wallets/woop-cli)
> for more details & commands.
### Rosetta tests
@ -194,8 +186,8 @@ To run this test, do:
make test-rosetta
```
This test starts a localnet (within the Docker container), **ensures it reaches a consensus**, and runs the Construction & Data API checks using the [rosetta-cli](https://github.com/coinbase/rosetta-cli).
This test also acts as a preliminary integration test (more through tests are done on the testnets).
> The config for this test can be found [here](https://github.com/harmony-one/harmony-test/blob/master/localnet/configs/localnet_rosetta_test_s0.json) & [here](https://github.com/harmony-one/harmony-test/blob/master/localnet/configs/localnet_rosetta_test_s1.json)
This test also acts as a preliminary integration test (more thorough tests are done on the testnets).
> The config for this test can be found [here](https://github.com/woop-chain/woop-test/blob/master/localnet/configs/localnet_rosetta_test_s0.json) & [here](https://github.com/woop-chain/woop-test/blob/master/localnet/configs/localnet_rosetta_test_s1.json)
Similar to the RPC tests, if you wish to debug further with the localnet after the tests are done, open a new shell and run:
```bash
@ -204,10 +196,10 @@ make test-rosetta-attach
## License
Harmony is licensed under GNU Lesser General Public License v3.0. See [`LICENSE`](LICENSE) file for
Woop is licensed under GNU Lesser General Public License v3.0. See [`LICENSE`](LICENSE) file for
the terms and conditions.
Harmony includes third-party open-source code. In general, a source subtree
Woop includes third-party open-source code. In general, a source subtree
with a `LICENSE` or `COPYRIGHT` file is from a third party, and our
modifications thereto are licensed under the same third-party open source
license.
@ -216,7 +208,7 @@ Also please see [our Fiduciary License Agreement](FLA.md) if you are
contributing to the project. By your submission of your contribution to us, you
and we mutually agree to the terms and conditions of the agreement.
## Contributing To Harmony
## Contributing To Woop
See [`CONTRIBUTING`](CONTRIBUTING.md) for details.
@ -235,10 +227,3 @@ See [`CONTRIBUTING`](CONTRIBUTING.md) for details.