Corda Walking the Chain in finalityFlow
In Corda, FinalityFlow:
- Verifies transaction on initiator node
- Notarizes transaction
- Persists signedTransaction to vault of initiator
- Distributes transaction to the
participants
As per consensus, verification involves walking the chain.
I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?
Do the notary and the participants
also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?
As per my understanding, SendTransactionFlow
sends the transaction to the other parties on the participants
lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?
I need to understand walking the chain from a coding perspective.
corda
add a comment |
In Corda, FinalityFlow:
- Verifies transaction on initiator node
- Notarizes transaction
- Persists signedTransaction to vault of initiator
- Distributes transaction to the
participants
As per consensus, verification involves walking the chain.
I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?
Do the notary and the participants
also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?
As per my understanding, SendTransactionFlow
sends the transaction to the other parties on the participants
lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?
I need to understand walking the chain from a coding perspective.
corda
add a comment |
In Corda, FinalityFlow:
- Verifies transaction on initiator node
- Notarizes transaction
- Persists signedTransaction to vault of initiator
- Distributes transaction to the
participants
As per consensus, verification involves walking the chain.
I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?
Do the notary and the participants
also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?
As per my understanding, SendTransactionFlow
sends the transaction to the other parties on the participants
lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?
I need to understand walking the chain from a coding perspective.
corda
In Corda, FinalityFlow:
- Verifies transaction on initiator node
- Notarizes transaction
- Persists signedTransaction to vault of initiator
- Distributes transaction to the
participants
As per consensus, verification involves walking the chain.
I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?
Do the notary and the participants
also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?
As per my understanding, SendTransactionFlow
sends the transaction to the other parties on the participants
lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?
I need to understand walking the chain from a coding perspective.
corda
corda
edited Nov 15 '18 at 11:17
Joel
11.1k11429
11.1k11429
asked Nov 15 '18 at 7:22
vishal gawdevishal gawde
738
738
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In FinalityFlow
, the caller uses the following line to send the notarised transaction to the participants
of all the states:
subFlow(SendTransactionFlow(session, notarised))
If we look at AbstractNode.installCoreFlows
, we see that the node installs a default handler for FinalityFlow
called FinalityHandler
. FinalityHandler
responds to the call to SendTransactionFlow
in FinalityFlow
by calling ReceiveTransactionFlow
.
Inside ReceiveTransactionFlow
, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:
val stx = otherSideSession.receive<SignedTransaction>().unwrap {
subFlow(ResolveTransactionsFlow(it, otherSideSession))
it.verify(serviceHub, checkSufficientSignatures)
it
}
As part of resolving the transaction's dependencies in ResolveTransactionsFlow
, the node verifies each one and checks its signatures (by default, verify
checks the signatures on the transaction):
result.forEach {
it.verify(serviceHub)
serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
}
The notary will only walk the chain in this way if they are a validating notary.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314281%2fcorda-walking-the-chain-in-finalityflow%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In FinalityFlow
, the caller uses the following line to send the notarised transaction to the participants
of all the states:
subFlow(SendTransactionFlow(session, notarised))
If we look at AbstractNode.installCoreFlows
, we see that the node installs a default handler for FinalityFlow
called FinalityHandler
. FinalityHandler
responds to the call to SendTransactionFlow
in FinalityFlow
by calling ReceiveTransactionFlow
.
Inside ReceiveTransactionFlow
, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:
val stx = otherSideSession.receive<SignedTransaction>().unwrap {
subFlow(ResolveTransactionsFlow(it, otherSideSession))
it.verify(serviceHub, checkSufficientSignatures)
it
}
As part of resolving the transaction's dependencies in ResolveTransactionsFlow
, the node verifies each one and checks its signatures (by default, verify
checks the signatures on the transaction):
result.forEach {
it.verify(serviceHub)
serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
}
The notary will only walk the chain in this way if they are a validating notary.
add a comment |
In FinalityFlow
, the caller uses the following line to send the notarised transaction to the participants
of all the states:
subFlow(SendTransactionFlow(session, notarised))
If we look at AbstractNode.installCoreFlows
, we see that the node installs a default handler for FinalityFlow
called FinalityHandler
. FinalityHandler
responds to the call to SendTransactionFlow
in FinalityFlow
by calling ReceiveTransactionFlow
.
Inside ReceiveTransactionFlow
, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:
val stx = otherSideSession.receive<SignedTransaction>().unwrap {
subFlow(ResolveTransactionsFlow(it, otherSideSession))
it.verify(serviceHub, checkSufficientSignatures)
it
}
As part of resolving the transaction's dependencies in ResolveTransactionsFlow
, the node verifies each one and checks its signatures (by default, verify
checks the signatures on the transaction):
result.forEach {
it.verify(serviceHub)
serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
}
The notary will only walk the chain in this way if they are a validating notary.
add a comment |
In FinalityFlow
, the caller uses the following line to send the notarised transaction to the participants
of all the states:
subFlow(SendTransactionFlow(session, notarised))
If we look at AbstractNode.installCoreFlows
, we see that the node installs a default handler for FinalityFlow
called FinalityHandler
. FinalityHandler
responds to the call to SendTransactionFlow
in FinalityFlow
by calling ReceiveTransactionFlow
.
Inside ReceiveTransactionFlow
, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:
val stx = otherSideSession.receive<SignedTransaction>().unwrap {
subFlow(ResolveTransactionsFlow(it, otherSideSession))
it.verify(serviceHub, checkSufficientSignatures)
it
}
As part of resolving the transaction's dependencies in ResolveTransactionsFlow
, the node verifies each one and checks its signatures (by default, verify
checks the signatures on the transaction):
result.forEach {
it.verify(serviceHub)
serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
}
The notary will only walk the chain in this way if they are a validating notary.
In FinalityFlow
, the caller uses the following line to send the notarised transaction to the participants
of all the states:
subFlow(SendTransactionFlow(session, notarised))
If we look at AbstractNode.installCoreFlows
, we see that the node installs a default handler for FinalityFlow
called FinalityHandler
. FinalityHandler
responds to the call to SendTransactionFlow
in FinalityFlow
by calling ReceiveTransactionFlow
.
Inside ReceiveTransactionFlow
, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:
val stx = otherSideSession.receive<SignedTransaction>().unwrap {
subFlow(ResolveTransactionsFlow(it, otherSideSession))
it.verify(serviceHub, checkSufficientSignatures)
it
}
As part of resolving the transaction's dependencies in ResolveTransactionsFlow
, the node verifies each one and checks its signatures (by default, verify
checks the signatures on the transaction):
result.forEach {
it.verify(serviceHub)
serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
}
The notary will only walk the chain in this way if they are a validating notary.
answered Nov 15 '18 at 11:23
JoelJoel
11.1k11429
11.1k11429
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314281%2fcorda-walking-the-chain-in-finalityflow%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown