aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
13 daysSimplify proxy NAT checking logicHEADmainitchyonion
2024-05-09Use ptutil for safelog and prometheus rounded metricsmeskio
* Related: #40354
2024-03-18Bump version to v2.9.2v2.9.2Cecylia Bocovich
2024-03-12Merge remote-tracking branch 'origin/mr/258'meskio
2024-03-09Implement better client IP per rendezvous method tracking for clientsMichael Pu
Implement better client IP per rendezvous method tracking for clients Add tests for added code, fix existing tests chore(deps): update module github.com/miekg/dns to v1.1.58 Implement better client IP tracking for http and ampcache Add tests for added code, fix existing tests Implement GetCandidateAddrs from SDP Add getting client IP for SQS Bug fixes Bug fix for tests
2024-03-09Switch to sqscreds param for passing in SQS credentialsMichael Pu
2024-02-27Bump version to v2.9.1v2.9.1Cecylia Bocovich
2024-02-17refactor: change deprecated "io/ioutil" package to recommended "io" packageam3o
2024-02-05Bump version to v2.9.0v2.9.0Cecylia Bocovich
2024-01-31Move RendezvousMethod field to messages.ArgAnthony Chang
2024-01-22Add mocks and interfaces for testing SQS rendezvousAnthony Chang
Co-authored-by: Michael Pu <michael.pu@uwaterloo.ca>
2024-01-08Scrub space separated ip addressesArlo Breault
The issue with ReplaceAllFunc is that it's capturing the leading and trailing spaces in the regexp, so successive ips don't match. From the docstring, > If 'All' is present, the routine matches successive non-overlapping > matches of the entire expression. For #40306
2024-01-04Add vcs revision to version stringgl40285Arlo Breault
For #40285
2023-12-21Bump version to v2.8.1v2.8.1Cecylia Bocovich
2023-11-21Merge branch 'encapsulation-readdata-buffer'David Fifield
2023-11-20Bump version to 2.8.0v2.8.0Cecylia Bocovich
2023-11-07Have encapsulation.ReadData return an error when the buffer is short.David Fifield
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/154#note_2919109 Still ignoring the io.ErrShortBuffer at the callers, which retains current behavior.
2023-11-07Have encapsulation.ReadData read into a provided buffer.David Fifield
Instead of unconditionally allocating its own.
2023-10-31Process and properly log connection closure statsCecylia Bocovich
2023-10-30Modify EventOnProxyStats to include summary dataCecylia Bocovich
2023-10-30Move creation of periodic stats task inside proxy libraryCecylia Bocovich
This adds a new type of SnowflakeEvent. EventOnProxyStats is triggered by the periodic task run at SummaryInterval and produces an event with a proxy stats output string.
2023-10-24Add outbound proxy configuration propagationShelikhoo
2023-10-24Add transport wrapperShelikhoo
2023-10-24Add common proxy utilitiesShelikhoo
2023-10-16update version to 2.7.0v2.7.0Shelikhoo
2023-10-09Remove proxy churn measurements from broker.David Fifield
We've done the analysis we planned to do on these measurements. A program to analyze the proxy churn and extract hour-by-hour intersections is available at: https://github.com/turfed/snowflake-paper/tree/main/figures/proxy-churn Closes #40280.
2023-09-20Use ShouldBeNil to check for nil valuesrenovate/github.com-smartystreets-goconvey-1.xmr-origin-165Cecylia Bocovich
2023-09-11update version to v2.6.1v2.6.1Shelikhoo
2023-06-29Close temporary UDPSession in TestQueuePacketConnWriteToKCP.David Fifield
With these not being closed, they were continuing to consume resources after the return of the test function, which was affecting the later BenchmarkSendQueue. Before: ``` snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -v === RUN TestQueueIncomingOversize --- PASS: TestQueueIncomingOversize (0.00s) === RUN TestWriteToOversize --- PASS: TestWriteToOversize (0.00s) === RUN TestRestoreMTU --- PASS: TestRestoreMTU (0.00s) === RUN TestRestoreCap --- PASS: TestRestoreCap (0.00s) === RUN TestQueuePacketConnWriteToKCP --- PASS: TestQueuePacketConnWriteToKCP (1.01s) goos: linux goarch: amd64 pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel cpu: Intel(R) Core(TM) i5 CPU 680 @ 3.60GHz BenchmarkSendQueue BenchmarkSendQueue-4 8519708 136.0 ns/op PASS ok gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel 3.481s ``` After: ``` snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -v === RUN TestQueueIncomingOversize --- PASS: TestQueueIncomingOversize (0.00s) === RUN TestWriteToOversize --- PASS: TestWriteToOversize (0.00s) === RUN TestRestoreMTU --- PASS: TestRestoreMTU (0.00s) === RUN TestRestoreCap --- PASS: TestRestoreCap (0.00s) === RUN TestQueuePacketConnWriteToKCP --- PASS: TestQueuePacketConnWriteToKCP (1.02s) goos: linux goarch: amd64 pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel cpu: Intel(R) Core(TM) i5 CPU 680 @ 3.60GHz BenchmarkSendQueue BenchmarkSendQueue-4 11620237 105.7 ns/op PASS ok gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel 3.244s ```
2023-06-29Fix a comment left over from turbotunnel-quic.David Fifield
2023-06-19Update version to v2.6.0v2.6.0Cecylia Bocovich
2023-06-14Append Let's Encrypt ISRG Root X1 to cert poolCecylia Bocovich
This is a workaround for older versions of android that do not trust the Let's Encrypt root certificate. https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40087
2023-05-31Move the development to gitlabmeskio
Related: tpo/anti-censorship/team#86
2023-04-20Add a scanner error check to ClusterCounter.Count.David Fifield
It was silently exiting at the "recordingStart":"2022-09-23T17:06:59.680537075Z" line, the first line whose length (66873) exceeds bufio.MaxScanTokenSize. Now distinctcounter exits with an error status instead of reporting partial results. $ ./distinctcounter -from 2023-01-01T00:00:00Z -to 2023-01-10T00:00:00Z -in metrics-ip-salted.jsonl 2023/04/20 13:54:11 unable to count:bufio.Scanner: token too long
2023-04-04Use a sync.Pool to reuse packet buffers in QueuePacketConn.David Fifield
This is meant to reduce overall allocations. See past discussion at https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40260#note_2885524 ff.
2023-04-04Fix loop termination in TestQueuePacketConnWriteToKCP.David Fifield
The noise-generating goroutine was meant to stop when the parent function returned and closed the `done` channel. The `break` in the loop was wrongly exiting only from the `select`, not from the `for`. This was the cause of banchmark anomalies in https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40260#note_2885832. The noise-generating loop from the test was continuing to run while the benchmarks were running.
2023-04-04Use a static array in benchmarks.David Fifield
Since d2858aeb7ec50ae09b9a7e2e2a910ae31cec62bd the caller is permitted to reuse its slice again.
2023-04-04Comment typo.David Fifield
2023-03-13Fix comment typo on NewRedialPacketConn.David Fifield
2023-03-13Revert "Take ownership of buffer in QueuePacketConn QueueIncoming/WriteTo."David Fifield
This reverts commit 839d2218837dfbd1682ff39b375f45660b3974b5. (Except for the added benchmarks in queuepacketconn_test.go.) This change corresponds to the issues #40187 and #40199. The analysis in https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40199 was wrong; kcp-go does reuse the buffers it passes to QueuePacketConn.WriteTo. This led to unsynchronized reuse of packet buffers and mangled packets observable at the client: https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40260. Undoing the change in QueuePacketConn.QueueIncoming as well, for symmetry, even though it is not implicated in any correctness problems.
2023-03-13Test for data race with QueuePacketConn.WriteTo and kcp-go.David Fifield
For #40260.
2023-01-18Update version to v2.5.1v2.5.1Shelikhoo
2023-01-18Update Version to v2.5.0v2.5.0Shelikhoo
2023-01-16Bump version to v2.4.3v2.4.3Cecylia Bocovich
2022-12-12add some more test for URL encoded IPs (safelog)Flo418
2022-12-08Take ownership of buffer in QueuePacketConn QueueIncoming/WriteTo.David Fifield
This design is easier to misuse, because it allows the caller to modify the contents of the slice after queueing it, but it avoids an extra allocation + memmove per incoming packet. Before: $ go test -bench='Benchmark(QueueIncoming|WriteTo)' -benchtime=2s -benchmem BenchmarkQueueIncoming-4 7001494 342.4 ns/op 1024 B/op 2 allocs/op BenchmarkWriteTo-4 3777459 627 ns/op 1024 B/op 2 allocs/op After: $ go test -bench=BenchmarkWriteTo -benchtime 2s -benchmem BenchmarkQueueIncoming-4 13361600 170.1 ns/op 512 B/op 1 allocs/op BenchmarkWriteTo-4 6702324 373 ns/op 512 B/op 1 allocs/op Despite the benchmark results, the change in QueueIncoming turns out not to have an effect in practice. It appears that the compiler had already been optimizing out the allocation and copy in QueueIncoming. https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40187 The WriteTo change, on the other hand, in practice reduces the frequency of garbage collection. https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40199
2022-12-08Reduce turbotunnel queueSize from 2048 to 512.David Fifield
This is to reduce heap usage. https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40179 Past discussion of queueSize: https://lists.torproject.org/pipermail/anti-censorship-team/2021-July/000188.html https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/48#note_2744619
2022-12-08Manually unlock the mutex in ClientMap.SendQueue.David Fifield
Rather than use defer. It is only a tiny amount faster, but this function is frequently called. Before: $ go test -bench=BenchmarkSendQueue -benchtime=2s BenchmarkSendQueue-4 15901834 151 ns/op After: $ go test -bench=BenchmarkSendQueue -benchtime=2s BenchmarkSendQueue-4 15859948 147 ns/op https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40177
2022-12-01Bump version to v2.4.1v2.4.1Cecylia Bocovich
2022-11-29Refactor utls roundtripper_test to deduplicateShelikhoo