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

WIP: 3PH #533

Draft
wants to merge 53 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c7568bb
Merge branch 'snapshot-clienthook' into 3ph
zenhack Jun 23, 2023
a18cfe6
WIP: emit a senderPromise for third party caps
zenhack Jun 24, 2023
00016f7
Merge branch 'generic-idgen' into 3ph
zenhack Jun 24, 2023
487a0bc
Drop unnecessary cast.
zenhack Jun 24, 2023
9b95244
Fill in question ID on provide.
zenhack Jun 24, 2023
9d21dc8
More work on sending the provide message.
zenhack Jun 24, 2023
e5273b1
First pass at some of the vine logic.
zenhack Jun 24, 2023
bcffd64
Allocate provide ids from srcConn
zenhack Jun 25, 2023
7e8c3ca
Start fleshing out data structures for 3PH.
zenhack Jun 25, 2023
0687477
First pass at handling disembargo with context.accept.
zenhack Jun 25, 2023
f55caaf
Shut down the vine if sending resolve fails.
zenhack Jun 25, 2023
1b5266a
package testnetwork: export concrete type
zenhack Jun 25, 2023
b5411a9
DRY up some of the test network implementation.
zenhack Jun 25, 2023
06654da
test network: use the mutex package.
zenhack Jun 25, 2023
46cba7c
TestNetwork: add a DialTransport method.
zenhack Jun 25, 2023
63b6cf5
Rework some bits of the Network interface.
zenhack Jun 25, 2023
1fba9f0
Add basic test for testnetwork.
zenhack Jun 25, 2023
a1349f3
Test network: make implementation a pointer.
zenhack Jun 26, 2023
ddf4c10
Document that Networks must be comparable.
zenhack Jun 26, 2023
eef25d0
Start working on a test for 3PH
zenhack Jun 26, 2023
9a2b2b8
Fix out of bounds slice access
zenhack Jun 26, 2023
9461c10
Remove a TODO
zenhack Jun 26, 2023
4264f84
Clean up the vine properly if sending fails.
zenhack Jun 26, 2023
67b1a62
TestSendProvide: set an error reporter
zenhack Jun 26, 2023
38c547c
Fix Client leak in send3PHPromise
zenhack Jun 28, 2023
502cce5
3ph tests: check for call w/ promise and resolution.
zenhack Jun 28, 2023
b3e9fcb
Add a couple more 3PH checks
zenhack Jun 28, 2023
8e8efcc
Finish out TestSendProvide
zenhack Jun 29, 2023
0651043
Stub out vine tests & factor out doBootstrap()
zenhack Jun 29, 2023
68465af
Implement TestVineUseCancelsHandoff
zenhack Jun 29, 2023
8a1e2f1
Add missing messagetarget to call
zenhack Jun 29, 2023
601d9b9
Finish vine implementation.
zenhack Jun 29, 2023
fbbf0f4
Get vine test working.
zenhack Jun 29, 2023
f524899
Add some comments to tests
zenhack Jun 29, 2023
a71bc43
Implement other vine test.
zenhack Jun 29, 2023
837cb16
3PH: correctly handle sending resolves for dropped promises.
zenhack Jun 29, 2023
dbe07b0
AcceptIntroduced: SHOULD -> MUST
zenhack Jun 29, 2023
6816d38
Fix build errors
zenhack Jun 29, 2023
24b569a
Add a test for 3ph disembargos, and fix some issues.
zenhack Jun 29, 2023
eeed744
Merge remote-tracking branch 'origin/main' into 3ph
zenhack Jun 29, 2023
b8654f0
Merge branch 'releaseExport-dq' into 3ph
zenhack Jun 30, 2023
81901e0
Fix bitrot re: releaseExport signature
zenhack Jun 30, 2023
e18f75c
Fill in message target in provide disembargo.
zenhack Jun 30, 2023
43c0722
Fix 3ph disembargo test
zenhack Jun 30, 2023
1067d0e
Replace ErrorReporter with a structured logging interface.
zenhack Jun 30, 2023
9e8acf5
errReporter: no-op if Logger is nil.
zenhack Jun 30, 2023
3adf1db
Merge branch 'logger-interface' into 3ph
zenhack Jun 30, 2023
6cf0e01
Fix bitrot: ErrorReporter -> Logger
zenhack Jun 30, 2023
b2c7b80
3ph: warn on failed introduction.
zenhack Jun 30, 2023
d934815
Futureproof comment.
zenhack Jun 30, 2023
24e8008
Partially handle third party disembargos
zenhack Jun 30, 2023
abc5258
replace redundant logic with parsedMessageTarget.Encode
zenhack Jun 30, 2023
3d9ba97
send accept disembargos when necessary
zenhack Jun 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
484 changes: 484 additions & 0 deletions rpc/3ph_test.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions rpc/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func BenchmarkPingPong(b *testing.B) {
p1, p2 := net.Pipe()
srv := testcp.PingPong_ServerToClient(pingPongServer{})
conn1 := rpc.NewConn(rpc.NewStreamTransport(p2), &rpc.Options{
ErrorReporter: testErrorReporter{tb: b},
Logger: testErrorReporter{tb: b},
BootstrapClient: capnp.Client(srv),
})
defer func() {
Expand All @@ -86,7 +86,7 @@ func BenchmarkPingPong(b *testing.B) {
}
}()
conn2 := rpc.NewConn(rpc.NewStreamTransport(p1), &rpc.Options{
ErrorReporter: testErrorReporter{tb: b},
Logger: testErrorReporter{tb: b},
})
defer func() {
if err := conn2.Close(); err != nil {
Expand Down
30 changes: 27 additions & 3 deletions rpc/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,35 @@ var (
)

type errReporter struct {
ErrorReporter
Logger Logger
}

func (er errReporter) Debug(msg string, args ...any) {
if er.Logger != nil {
er.Logger.Debug(msg, args...)
}
}

func (er errReporter) Info(msg string, args ...any) {
if er.Logger != nil {
er.Logger.Info(msg, args...)
}
}

func (er errReporter) Warn(msg string, args ...any) {
if er.Logger != nil {
er.Logger.Warn(msg, args...)
}
}

func (er errReporter) Error(msg string, args ...any) {
if er.Logger != nil {
er.Logger.Error(msg, args...)
}
}

func (er errReporter) ReportError(err error) {
if er.ErrorReporter != nil && err != nil {
er.ErrorReporter.ReportError(err)
if err != nil {
er.Error(err.Error())
}
}
Loading