Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progpow Implementation #1030

Closed
wants to merge 82 commits into from
Closed

Progpow Implementation #1030

wants to merge 82 commits into from

Conversation

AndreaLanfranchi
Copy link
Contributor

@AndreaLanfranchi AndreaLanfranchi commented May 7, 2021

ProgPow Implementation

barrystyle and others added 30 commits April 6, 2021 21:14
* FIRO block time is 300 seconds
* passing the epoch is wrong
* only height provides right period
* no need for ancillary int
* simply reset ptr
* remove unneeded pseud context caching
* skip initial 0x if present
* make helper method safe against 0x
* for progpow (and !mtp) it keeps hashing nHeight + 1
* it lacks mix_hash (which is required)
* who has requested timings ?
* best hash has no sense if it doesnt' match the boundary
* use hash256_from_bytes instead of hasx string
* light hash when mix_hash is known
@AndreaLanfranchi
Copy link
Contributor Author

@psolstice @reubenyap
Send hint about how to run properly the created tests.
Also give advice about why on my machine they fail like this

andrea@SKULL:~/firo-1$ make check -j4
Making check in src
make[1]: Entering directory '/home/andrea/firo-1/src'
Making check in tor
make[2]: Entering directory '/home/andrea/firo-1/src/tor'
make  check-TESTS check-local
make[3]: Entering directory '/home/andrea/firo-1/src/tor'
perl ./scripts/maint/checkSpace.pl -C \
        ./src/lib/*/*.[ch] ./src/core/*/*.[ch] ./src/feature/*/*.[ch] ./src/app/*/*.[ch] ./src/test/*.[ch] ./src/test/*/*.[ch] ./src/tools/*.[ch]
python3 ./scripts/maint/practracker/includes.py .
(warning) problem file-size /src/app/config/or_options_st.h 1128
(warning) problem file-size /src/core/mainloop/connection.c 5576
(warning) problem file-size /src/core/or/circuitpadding.c 3099
Unusual pattern permitted.h in ./scripts/maint/practracker/testdata
./scripts/maint/checkShellScripts.sh
(warning) problem file-size /src/core/or/connection_edge.c 4601
(warning) problem function-size /src/core/or/connection_edge.c:connection_ap_handshake_rewrite() 193
./scripts/maint/checkShellScripts.sh: Install shellcheck to check shell scripts.
(warning) problem file-size /src/feature/client/entrynodes.c 3825
(warning) problem function-size /src/feature/control/control_cmd.c:add_onion_helper_keyarg() 117
(warning) problem function-size /src/feature/dircache/dircache.c:directory_handle_command_post() 124
(warning) problem function-size /src/feature/dirparse/parsecommon.c:get_next_token() 165
(warning) problem file-size /src/feature/hs/hs_service.c 4188
(warning) problem file-size /src/feature/relay/router.c 3529
(warning) problem function-size /src/feature/relay/router.c:router_dump_router_to_string() 372

(warning) problem function-size /src/feature/rend/rendmid.c:rend_mid_establish_intro_legacy() 105
(warning) problem file-size /src/feature/rend/rendservice.c 4522
(warning) problem function-size /src/feature/rend/rendservice.c:rend_service_receive_introduction() 334
make[4]: Entering directory '/home/andrea/firo-1/src/tor'
SKIP: src/test/fuzz_static_testcases.sh
PASS: src/test/test_zero_length_keys.sh
PASS: src/test/test_key_expiration.sh
PASS: src/test/test_keygen.sh
PASS: src/test/test_workqueue_cancel.sh
PASS: src/test/test_workqueue_efd.sh
PASS: src/test/test_workqueue_efd2.sh
SKIP: src/test/test_switch_id.sh
PASS: src/test/test_cmdline.sh
PASS: src/test/test_parseconf.sh
PASS: src/test/test_workqueue_pipe.sh
PASS: src/test/test_ntor.sh
PASS: src/test/test_bt.sh
PASS: src/test/test_hs_ntor.sh
PASS: src/test/test_rebind.sh
PASS: scripts/maint/practracker/test_practracker.sh
PASS: src/test/test_workqueue_pipe2.sh
PASS: src/test/test-memwipe
PASS: src/test/test_workqueue_socketpair.sh
PASS: src/test/test_workqueue
PASS: src/test/test-slow
PASS: src/test/test
PASS: src/test/test-timers
============================================================================
Testsuite summary for tor 0.4.2.7
============================================================================
# TOTAL: 23
# PASS:  21
# SKIP:  2
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[4]: Leaving directory '/home/andrea/firo-1/src/tor'
make[3]: Leaving directory '/home/andrea/firo-1/src/tor'
make[2]: Leaving directory '/home/andrea/firo-1/src/tor'
Making check in bls-signatures
make[2]: Entering directory '/home/andrea/firo-1/src/bls-signatures'
./build/src/runtest
make[2]: ./build/src/runtest: Command not found
make[2]: *** [Makefile:19: check] Error 127
make[2]: Leaving directory '/home/andrea/firo-1/src/bls-signatures'
make[1]: *** [Makefile:15893: check-recursive] Error 1
make[1]: Leaving directory '/home/andrea/firo-1/src'
make: *** [Makefile:717: check-recursive] Error 1

@AndreaLanfranchi
Copy link
Contributor Author

  1. a way to test transition on regtest. I suggest adding command line argument to set HF time.

I don't have a clue of what you're talking about.

@psolstice
Copy link
Contributor

./build/src/runtest
make[2]: ./build/src/runtest: Command not found
make[2]: *** [Makefile:19: check] Error 127
make[2]: Leaving directory '/home/andrea/firo-1/src/bls-signatures'
make[1]: *** [Makefile:15893: check-recursive] Error 1
make[1]: Leaving directory '/home/andrea/firo-1/src'
make: *** [Makefile:717: check-recursive] Error 1

on Mac it's a known issue. Just run src/test/test_bitcoin manually to test. Use --run_test= to run specific test(s)

@psolstice
Copy link
Contributor

  1. a way to test transition on regtest. I suggest adding command line argument to set HF time.

I don't have a clue of what you're talking about.

Typically we use regtest for early testing (e.g. firo-qt -regtest) and then generate blocks with generate RPC. It works just fine when hardfork is defined by block number (you can add specific block number to regtest chain parameters is chainparams.cpp). But in your case hardfork moment is defined as specific moment of time and you can't hardcode it because you want the client to start running on old hash function, then transition to new one several minutes later. One idea how you can do it is with command line argument containing time of transition that would work only on regtest.

@lgtm-com
Copy link

lgtm-com bot commented Aug 17, 2021

This pull request fixes 5 alerts when merging 0432153 into dbce40b - view on LGTM.com

fixed alerts:

  • 5 for Unused static function

@psolstice
Copy link
Contributor

Replaced with #1071

@psolstice psolstice closed this Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants