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

CapTP using RhoTypes.proto under Agoric @endo/marshal #16

Open
7 tasks
dckc opened this issue Jan 11, 2022 · 7 comments
Open
7 tasks

CapTP using RhoTypes.proto under Agoric @endo/marshal #16

dckc opened this issue Jan 11, 2022 · 7 comments

Comments

@dckc
Copy link
Contributor

dckc commented Jan 11, 2022

@erights you expressed interest in the details when, after presenting marshal types and such, I said it's remarkable how much it looks like rholang.

Note the correspondence between marshal types and the rholang data structures in RhoTypes.proto (see also: cheat sheet, BNFC grammar):

@agoric/marshal rholang  
CopyArray Elist  
CopySet ESet  
CopyMap EMap
CopyTagged ??  
??  ETuple  
??  Par  
     
(pattern/matcher) EMatches
     
boolean g_bool  
bignum@@ g_int  
string g_string  
  g_uri  
  g_byte_array
null Nil The Nil process is a Par with no sends, receives, etc.
undefined
  • use CopyTagged for ETuple, (non-Nil) Par, g_uri, g_byte_array?
  • for undefined, add a distinguished UnforgeableName to the RChain registry
    • using insertSigned so that the representation doesn't depend on the state of the registry.

I wonder about a Justin context with makeCopySet and such in scope, bound to Set. It would look even more like rholang.

A possible fun project:

  • a suitable VatTP layer (#94)
  • implement the above marshaling layer
  • translate @agoric/captp to rholang using js2rho
    • built platform-specific parts that aren't suitable for this sort of translation

cc @Bill-Kunj , @jimscarver , @michaelfig

see also: OCapn
cc @cwebber

@dckc
Copy link
Contributor Author

dckc commented Jan 14, 2022

some type-directed prototyping: marshal-rhoproto.js

@dckc
Copy link
Contributor Author

dckc commented Jan 14, 2022

ordering?

rholang terms are totally ordered; that's too strong for remotables. plus I wonder if the arbitrary things like whether strings or numbers go first are consistent with compareKeys.

Here's hoping there are interesting interop targets that don't depend on the orders on both sides being exactly the same.

@dckc
Copy link
Contributor Author

dckc commented Jan 15, 2022

ag-solo as outboard IBC implementation for rnode

once we get rnode and ag-solo talking CapTP, rnode can talk IBC via ag-solo.

cosmos-testnet <-IBC-> ag-solo <-CapTP-> rnode

see also:

@tgrospic
Copy link
Member

tgrospic commented Mar 9, 2022

ordering?

rholang terms are totally ordered; that's too strong for remotables. plus I wonder if the arbitrary things like whether strings or numbers go first are consistent with compareKeys.

Here's hoping there are interesting interop targets that don't depend on the orders on both sides being exactly the same.

Rholang terms are normalized with total ordering so that they be hashed, but it's not required on the protocol level.

@dckc
Copy link
Contributor Author

dckc commented Mar 12, 2022

progress in office hours today:

https://github.com/rchain-community/js2rho/blob/captp/lib/capTPTool.js 331e08d

we saw in https://rhobot.net/rnode-log/ :

19:10:02.835 [�[34mINFO �[0;39m] [�[36mnode-runner-23      �[0;39m] [�[36mc.r.c.MultiParentCasperImpl  �[0;39m] - Received DeployData #1647112202396 -- {"type": "CTP_BOOTSTRAP", "epoch": 0, "questionID": "myid#1"}, Sig: 30440220603abc6545a6...20457cafead7228c134e, SigAlgorithm: secp256k1, ValidAfterBlockNumber: 146

cc @jimscarver

@dckc
Copy link
Contributor Author

dckc commented May 13, 2022

@dckc dckc transferred this issue from rchain-community/rchain-api May 14, 2022
@dckc
Copy link
Contributor Author

dckc commented May 14, 2022

More progress today, with @David405 @jimscarver
cc @Bill-Kunj

  • f6f90f7 * feat: send CapTP message in VatTP messaging layer

https://discord.com/channels/257555930173014017/687879575451336760/975035826067107900

~/projects/js2rho
11:24 connolly@jambox$ node lib/capTPTool.js 
TODO: start polling; call dispatch when a message is available
startTerm {
  deployRequest: {
    data: {
      term: '\n' +
        'new ack(`rho:rchain:deployId`), deployerId(`rho:rchain:deployerId`) in {\n' +
        '  match {[*deployerId, "3a240a220a2075a41673f53fb857d320099a088d796f2fc5a521c24db04f5c02c2864097f4d6"]} {\n' +
        '    {*target} => target!({"type": "CTP_BOOTSTRAP", "epoch": 0, "questionID": "myid#1"}, *ack)\n' +
        '  }\n' +
        '}',
      timestamp: 1652545499613,
      phloPrice: 1,
      phloLimit: 250000,
      validAfterBlockNumber: 158
    },
    sigAlgorithm: 'secp256k1',
    signature: '3045022100dabcdac473f2db8fc97cd21eeab45fefa7f03d13ccbd5e2fe718fff7dfadb68c02205fb1605685b7373974699211a31ffd72bdd88fc5ffa98255fbff8d824879d7aa',
    deployer: '04be064356846e36e485408df50b877dd99ba406d87208add4c92b3c7d4e4c663c2fbc6a1e6534c7e5c0aec00b26486fad1daf20079423b7c8ebffbbdff3682b58'
  }
}

new ack(`rho:rchain:deployId`), deployerId(`rho:rchain:deployerId`) in {
  match {[*deployerId, "3a240a220a2075a41673f53fb857d320099a088d796f2fc5a521c24db04f5c02c2864097f4d6"]} {
    {*target} => target!({"type": "CTP_BOOTSTRAP", "epoch": 0, "questionID": "myid#1"}, *ack)
  }
}

@dckc dckc changed the title CapTP using RhoTypes.proto under @agoric/marshal CapTP using RhoTypes.proto under Agoric @endo/marshal May 14, 2022
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

No branches or pull requests

2 participants