-
Notifications
You must be signed in to change notification settings - Fork 226
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
add initial block pool #139
Conversation
f58c522
to
326808b
Compare
@@ -0,0 +1,89 @@ | |||
# beacon_chain | |||
# Copyright (c) 2018 Status Research & Development GmbH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and elsewhere, what's the best thing to do with copyright years?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Omit or say "Copyright (c) 21st century, Status..."
I'm only half kidding, literally no one takes that in any way seriously, not even copyright lawyers (verified by two).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright 2018-Present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let's fix this on the whole repo after merging this, in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this PR isn't the place to fix that.
@@ -269,6 +269,7 @@ func get_beacon_proposer_index*(state: BeaconState, slot: Slot): ValidatorIndex | |||
# TODO this index is invalid outside of the block state transition function | |||
# because presently, `state.slot += 1` happens before this function | |||
# is called - see also testutil.getNextBeaconProposerIndex | |||
# TODO is the above still true? the shuffling has changed since it was written |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shuffling is still a function of seed
, which is a function of epoch
, so one would have to check beginning/end of epoch boundary conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think what would be useful here is a unit test that shows what's safe to do in terms of state-slot vs passed-in slot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -0,0 +1,89 @@ | |||
# beacon_chain | |||
# Copyright (c) 2018 Status Research & Development GmbH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright 2018-Present
info "Attestation resolved", | ||
slot = humaneSlotNum(attestation.data.slot), | ||
shard = attestation.data.shard, | ||
beaconBlockRoot = shortLog(attestation.data.beacon_block_root), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose shortLog is a truncated print from chronicles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, the idea being that we can define a function with one name for all types instead of a different name for ever type
@@ -31,6 +31,9 @@ type | |||
Eth2Digest* = MDigest[32 * 8] ## `hash32` from spec | |||
Eth2Hash* = blake2_512 ## Context for hash function | |||
|
|||
func shortLog*(x: Eth2Digest): string = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shortHash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one name for all
|
||
func shortHash(x: auto): string = | ||
($x)[0..7] | ||
topicfetchBlocks = "ethereum/2.1/beacon_chain/fetch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the intention here that this is a temporary solution?
In Brussels, we discussed that there will be a RequestManager
instance that will be responsible for querying a number of randomly selected peers for blocks and other data through the SyncProtocol
(which doesn't operate in broadcast fashion and sends the requests to specific peers).
The RequestManager
may have some configurable policy for trading latency for bandwidth (i.e. it will control how many redundant requests are send in parallel in case some of the peers don't respond in time). It will also keep reputation scores for the peers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, just an example to see if it works
@@ -59,35 +53,19 @@ USE_MULTITAIL="${USE_MULTITAIL:-no}" # make it an opt-in | |||
type "$MULTITAIL" &>/dev/null || USE_MULTITAIL="no" | |||
COMMANDS=() | |||
|
|||
for i in $(seq 0 9); do | |||
for i in $(seq 0 8); do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You explained this on the call, but the audio interrupted briefly for me. Why are we skipping the last node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea is to have one node to start easily separately (using ./run_node.sh 9
)
* implement in-memory block graph * store tail block in database * resolve unknown parents by syncing them from peers * introduce concept of resolved blocks and attestations - those that follow minimal protocol rules * update state head lazily * log more stuff * shortHash -> shortLog * start 9/10 beacon nodes by default, last can be started manually * see also #134 * fix start.sh epoch length
326808b
to
ddf00c9
Compare
Add tests for read() and write() deadlocks.
follow minimal protocol rules