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

Ledger integration #585

Merged
merged 22 commits into from
May 30, 2019
Merged

Ledger integration #585

merged 22 commits into from
May 30, 2019

Conversation

edsko
Copy link
Contributor

@edsko edsko commented May 30, 2019

Co-authored-by: Nicholas Clarke [email protected]
Co-authored-by: Thomas Winant [email protected]

Co-authored-by: Nicholas Clarke <[email protected]>
Co-authored-by: Thomas Winant <[email protected]>
Copy link
Contributor

@nc6 nc6 left a comment

Choose a reason for hiding this comment

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

Just taken a quick glance through this, but the changes look good

-- While the primitives in the ChainSync protocol are "roll back", "roll
-- forward (apply block)", etc. The /real/ primitive is "switch to
-- fork", which means that a roll back is always followed by applying at
-- least as many blocks that we rolled back.
Copy link
Contributor

Choose a reason for hiding this comment

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

This assumes that chain selection will always prefer a longer chain, which isn't necessarily the case?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, this assumes it will always prefer a chain that is at least as long as the current chain. That will be the case, right?

The `getCreator` method, which tells you which node produced a block, is used
in the checks of some consensus tests. The `getCreator` method takes a
`NodeConfig`, but we didn't have a `NodeConfig` in those testing contexts, so
we were using `error` instead. This was "fine" because this `NodeConfig` is
only really used for the real PBFT implementation, which is not used in the
tests, only in the demo. However, using `error` here is dirty and might work
for now, but that may change in the future.

Fix this by letting the test setup function return the `NodeConfig` for each
node in addition to its chain. This `NodeConfig` can then be passed to
`getCreator`.

Actually, `getCreator` would work with any `NodeConfig` from the test setup,
regardless to which node its corresponds. This is because `getCreator` only
reads data from the `NodeConfig` that is common to all nodes, no node-specific
data is used. Nonetheless, it is nicer to use the `NodeConfig` that belongs to
"correct" node.
Copy link
Contributor

@mrBliss mrBliss left a comment

Choose a reason for hiding this comment

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

I went through the whole PR in a Google Meet with Edsko and we have resolved all issues we had identified.

We can finally merge this! 🎉

@mrBliss
Copy link
Contributor

mrBliss commented May 30, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request May 30, 2019
585: Ledger integration r=mrBliss a=edsko

Co-authored-by: Nicholas Clarke <[email protected]>
Co-authored-by: Thomas Winant <[email protected]>

Co-authored-by: Edsko de Vries <[email protected]>
Co-authored-by: Thomas Winant <[email protected]>
@mrBliss mrBliss merged commit 4ac30d5 into master May 30, 2019
@iohk-bors iohk-bors bot deleted the edsko/int-demo/split branch May 30, 2019 17:41
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.

5 participants