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

Drand ignore env variable #697

Merged
merged 7 commits into from
Sep 14, 2020
Merged

Drand ignore env variable #697

merged 7 commits into from
Sep 14, 2020

Conversation

RajarupanSampanthan
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • Introduces drand flag in command line and config file
  • Prevents Drand block verification when Drand flag set to false

Reference issue to close (if applicable)

Closes
#642

Other information and links

@austinabell
Copy link
Contributor

This should be an env variable, not set through a CLI flag. For something like this, it's not worth passing around and storing the boolean just for these checks

@RajarupanSampanthan RajarupanSampanthan changed the title First commit Drand Verification Sep 10, 2020
@austinabell austinabell changed the title Drand Verification Drand ignore env variable Sep 11, 2020
header
.validate_block_drand(Arc::clone(&self.beacon), prev_beacon)
.await?;
if std::env::var("LOTUS_IGNORE_DRAND") == Ok("1".to_owned()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably doesn't need to be LOTUS_.. Can just trim that or have it prefixed with forest

@austinabell
Copy link
Contributor

You need the check inside of latest_beacon_entry to return a static beacon entry in the case of drand being ignored.

This is actually the more important one, because otherwise the node would just error whenever a block is being validated because the retrieval of a beacon entry would fail

Comment on lines 297 to 299
if std::env::var("IGNORE_DRAND") == Ok("1".to_owned()) {
return Ok(BeaconEntry::default());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah this check should happen at the end of checking for drand entries. and can you have the bytes be the same as Lotus for interop reasons (if we want to interop without drand with both clients)

blockchain/beacon/src/drand.rs Show resolved Hide resolved
@RajarupanSampanthan RajarupanSampanthan merged commit 96b64cb into main Sep 14, 2020
@RajarupanSampanthan RajarupanSampanthan deleted the rupan/drand_flag branch September 14, 2020 14:33
timvermeulen added a commit that referenced this pull request Sep 17, 2020
commit 8ef5ae5
Author: Austin Abell <austinabell8@gmail.com>
Date:   Wed Sep 16 12:30:01 2020 -0400

    Peer stats tracking and selection (#701)

    * Added peer manager logic and started to move blocksync handling into network context

    * Migrate to using handled blocksync requests and remove a duplicate code

    * Fix test use

    * Fix duration subtract logic

    * Update peer manager updates from hello requests

    * Docs and cleanup

    * more cleanup

commit dc0ff4c
Author: Eric Tu <6364934+ec2@users.noreply.github.com>
Date:   Tue Sep 15 14:43:18 2020 -0400

    Semantic Validation for Messages (#703)

    * semantic validation

    * suggestions

    * suggestions

commit 3411459
Author: Austin Abell <austinabell8@gmail.com>
Date:   Mon Sep 14 15:14:48 2020 -0400

    ChainSync refactor (#693)

    * Switch chain store to threadsafe

    * Update genesis to arc reference

    * wip refactoring chain sync to workers in async tasks

    * Update network event handling and remove NetworkHandler

    * Update tipset scheduling logic

    * Update peer retrieval to take a random sample of available peers

    * Cleanup and enabling all existing tests

    * fix worker task spawn

    * Add TODO for emit event ignoring and change to error log

    * oops

    * Update comment

    * Fix typo

commit 66ca99e
Author: Eric Tu <6364934+ec2@users.noreply.github.com>
Date:   Mon Sep 14 13:48:22 2020 -0400

    Fix StateManager use in different components (#694)

    * wrap sm in arc

    * lint

    * fix tests

    * suggestions

    * clippy

commit 96b64cb
Author: nannick <rajarupans@gmail.com>
Date:   Mon Sep 14 10:33:27 2020 -0400

    Drand ignore env variable (#697)

    * First commit

    * Using enviromental vairable instead of cli flag

    * FIxing dumb mistakes

    * Renaming drand flag

    * UPdate latest_beacon_entry

    * Adding drand check

    * Adding doc

commit 548a464
Author: Austin Abell <austinabell8@gmail.com>
Date:   Thu Sep 10 13:22:22 2020 -0400

    Print out conformance results and add log for skips (#695)

commit 0d7b16c
Author: Stepan <s.s.naumov@gmail.com>
Date:   Tue Sep 8 09:01:05 2020 -0400

    Add CLI command to add Genesis Miner to Genesis Template (#644)

    * AddMinerGenesis cmd command

    * fixing tests

    * addressing comments

    * removing jsons
timvermeulen added a commit that referenced this pull request Sep 26, 2020
* WIP

* More changes

* Even more changes

* Amt docs

* Clippy & copyright

* Squashed commit of the following:

commit 8ef5ae5
Author: Austin Abell <austinabell8@gmail.com>
Date:   Wed Sep 16 12:30:01 2020 -0400

    Peer stats tracking and selection (#701)

    * Added peer manager logic and started to move blocksync handling into network context

    * Migrate to using handled blocksync requests and remove a duplicate code

    * Fix test use

    * Fix duration subtract logic

    * Update peer manager updates from hello requests

    * Docs and cleanup

    * more cleanup

commit dc0ff4c
Author: Eric Tu <6364934+ec2@users.noreply.github.com>
Date:   Tue Sep 15 14:43:18 2020 -0400

    Semantic Validation for Messages (#703)

    * semantic validation

    * suggestions

    * suggestions

commit 3411459
Author: Austin Abell <austinabell8@gmail.com>
Date:   Mon Sep 14 15:14:48 2020 -0400

    ChainSync refactor (#693)

    * Switch chain store to threadsafe

    * Update genesis to arc reference

    * wip refactoring chain sync to workers in async tasks

    * Update network event handling and remove NetworkHandler

    * Update tipset scheduling logic

    * Update peer retrieval to take a random sample of available peers

    * Cleanup and enabling all existing tests

    * fix worker task spawn

    * Add TODO for emit event ignoring and change to error log

    * oops

    * Update comment

    * Fix typo

commit 66ca99e
Author: Eric Tu <6364934+ec2@users.noreply.github.com>
Date:   Mon Sep 14 13:48:22 2020 -0400

    Fix StateManager use in different components (#694)

    * wrap sm in arc

    * lint

    * fix tests

    * suggestions

    * clippy

commit 96b64cb
Author: nannick <rajarupans@gmail.com>
Date:   Mon Sep 14 10:33:27 2020 -0400

    Drand ignore env variable (#697)

    * First commit

    * Using enviromental vairable instead of cli flag

    * FIxing dumb mistakes

    * Renaming drand flag

    * UPdate latest_beacon_entry

    * Adding drand check

    * Adding doc

commit 548a464
Author: Austin Abell <austinabell8@gmail.com>
Date:   Thu Sep 10 13:22:22 2020 -0400

    Print out conformance results and add log for skips (#695)

commit 0d7b16c
Author: Stepan <s.s.naumov@gmail.com>
Date:   Tue Sep 8 09:01:05 2020 -0400

    Add CLI command to add Genesis Miner to Genesis Template (#644)

    * AddMinerGenesis cmd command

    * fixing tests

    * addressing comments

    * removing jsons

* Delete old deadline tests

* Fix verify_block_signature

* Fix state_api

* Silent unused variable warnings

* clippy

* clippy

* clippy

* Fix miner worker addr function

* fix load_sectors_from_set

* Fix get_miner_info

* miner faults update

* Setup faults and recoveries logic

* Add todo for checking verification function

* Update to specs-actors v0.9.3

* Fix test

* Remove Cid.Undef check

* PR fixes

* Use the actor_error! macro in the miner actor

* Fix type mismatch

* PR changes

* Use return value

* Rename file

* More PR fixes

* Add assertions and error message

* Downcast errors originating from Deadlines::{load_deadline, update_deadline} and State::save_deadlines

* Rename Sectors::{new, load} to Sectors::{load, load_sector}

* Fix inverted logic

* Fix state manager

* Remove unused parameters

* clippy

* Replace function by const, remove duplication, remove comment

* Rename field, fix macro formatting, remove unnecessary vec

* Downcast errors

Co-authored-by: austinabell <austinabell8@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants