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

Merge dev -> master #1040

Merged
merged 241 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
7a0446c
build(deps): bump golang.org/x/crypto from 0.18.0 to 0.19.0
dependabot[bot] Feb 12, 2024
4142780
Merge pull request #949 from SiaFoundation/dependabot/go_modules/gola…
ChrisSchinnerl Feb 12, 2024
6b53986
build(deps): bump gorm.io/driver/sqlite from 1.5.4 to 1.5.5
dependabot[bot] Feb 12, 2024
296c4e9
Merge pull request #951 from SiaFoundation/dependabot/go_modules/gorm…
ChrisSchinnerl Feb 12, 2024
279f620
stores: add TestUploadObject
ChrisSchinnerl Feb 12, 2024
c9d27dd
stores: extend test to cover contract sectors
ChrisSchinnerl Feb 12, 2024
7d75df5
stores: rename test
ChrisSchinnerl Feb 12, 2024
5399488
stores: gofmt
ChrisSchinnerl Feb 12, 2024
122715a
worker: fix debug message
ChrisSchinnerl Feb 12, 2024
e5f52f1
Merge pull request #953 from SiaFoundation/chris/test-upload-object
ChrisSchinnerl Feb 12, 2024
3b851fd
autopilot: increase resolver timeout to 10s
ChrisSchinnerl Feb 12, 2024
bbb0590
worker: fail upload/download request if uploader/downloader was stopped
ChrisSchinnerl Feb 13, 2024
49475fa
worker: add tests
ChrisSchinnerl Feb 13, 2024
645f93a
worker: increase timeout in tests for CI
ChrisSchinnerl Feb 13, 2024
afafc0d
alerts: add pagination to alerts endpoint and add another endpoint to…
ChrisSchinnerl Feb 13, 2024
87de904
worker: remove context value interaction recorder
n8maninger Feb 13, 2024
fee0b6c
worker: ensure applying MigrationSurchargeMultiplier never prevents a…
peterjan Feb 14, 2024
3ca11cb
worker: get rid of interaction middleware
peterjan Feb 14, 2024
742aa13
Merge pull request #959 from SiaFoundation/nate/remove-context-based-…
ChrisSchinnerl Feb 14, 2024
d90e42f
stores: allow for filtering object stats by bucket
ChrisSchinnerl Feb 14, 2024
b22e96e
bus: address comments
ChrisSchinnerl Feb 14, 2024
dff33cd
bus: fix jape
ChrisSchinnerl Feb 14, 2024
7ac03a4
Merge pull request #960 from SiaFoundation/pj/adjusted-gouging-settings
ChrisSchinnerl Feb 14, 2024
ba41276
Merge pull request #954 from SiaFoundation/chris/uploader-downloader-…
ChrisSchinnerl Feb 14, 2024
ea173eb
stores: binary currency type
ChrisSchinnerl Feb 14, 2024
fe79e07
ui: v0.45.0
ChrisSchinnerl Feb 15, 2024
72d514b
Merge pull request #967 from SiaFoundation/ui/update
ChrisSchinnerl Feb 15, 2024
793dd2f
autopilot: dismiss lost sector alerts when there are no lost sectors
ChrisSchinnerl Feb 15, 2024
73fd775
Merge pull request #961 from SiaFoundation/chris/objects-stats-bucket
ChrisSchinnerl Feb 15, 2024
a52b3a7
stores: fix metric migrations
peterjan Feb 15, 2024
cc83fc9
stores: improve performance of objects stats
ChrisSchinnerl Feb 15, 2024
1592760
stores: use select count with subquery
ChrisSchinnerl Feb 15, 2024
47a91ac
stores: use sectors table and don't filter sectors stats by bucket
ChrisSchinnerl Feb 15, 2024
3e463cf
stores: use sum over total shards
ChrisSchinnerl Feb 15, 2024
3f6dad7
stores: use contract size for total uploaded size
ChrisSchinnerl Feb 15, 2024
2c627d9
testing: fix TestUploadDownloadExtended
ChrisSchinnerl Feb 15, 2024
c3802d8
stores: fix TestSlabBufferStats
ChrisSchinnerl Feb 16, 2024
6ed8e75
stores: use WHERE EXISTS
ChrisSchinnerl Feb 16, 2024
5f8233f
stores: remove subquery
ChrisSchinnerl Feb 16, 2024
f68e6ee
stores: remove contract query
ChrisSchinnerl Feb 16, 2024
e19ff56
Merge pull request #964 from SiaFoundation/chris/binary-currency
ChrisSchinnerl Feb 16, 2024
074cbef
Merge pull request #968 from SiaFoundation/chris/dismiss-lost-sectors…
ChrisSchinnerl Feb 16, 2024
025df16
Merge pull request #958 from SiaFoundation/chris/dismiss-all-alerts
ChrisSchinnerl Feb 16, 2024
fe2097a
bus: merge alert dismiss routes
ChrisSchinnerl Feb 16, 2024
a13313b
bus: add onlymetadata flag to objects endpoint
ChrisSchinnerl Feb 16, 2024
0100379
testing: fix TestS3Basic
ChrisSchinnerl Feb 16, 2024
781290d
worker: fix ndf in TestDownloaderStopped
ChrisSchinnerl Feb 16, 2024
f0ea509
worker: fix ndf in TestDownloaderStopped
ChrisSchinnerl Feb 16, 2024
814b8e5
bus: add generateKey option to create multipart endpoint
ChrisSchinnerl Feb 16, 2024
a2035a8
bus: remove DisablePreshardingEncryption
ChrisSchinnerl Feb 16, 2024
cd72207
Merge pull request #971 from SiaFoundation/chris/merge-dismiss-routes
ChrisSchinnerl Feb 16, 2024
07bbbb1
testing: fix TestMultipartUploads
ChrisSchinnerl Feb 16, 2024
9051e47
stores: get rid of migrate bool
peterjan Feb 16, 2024
e0b3dc0
object: fix panic in objects.String
ChrisSchinnerl Feb 16, 2024
e7f6bb4
testing: fix TestS3Basic
ChrisSchinnerl Feb 16, 2024
93bb567
build(deps): bump github.com/minio/minio-go/v7 from 7.0.66 to 7.0.67
dependabot[bot] Feb 19, 2024
9431952
build(deps): bump gorm.io/driver/mysql from 1.5.2 to 1.5.4
dependabot[bot] Feb 19, 2024
38cdc3c
Merge pull request #978 from SiaFoundation/dependabot/go_modules/gorm…
ChrisSchinnerl Feb 19, 2024
264e4a6
Extend contract set change alerts with host info (#966)
peterjan Feb 19, 2024
6dc7acc
Merge pull request #977 from SiaFoundation/dependabot/go_modules/gith…
ChrisSchinnerl Feb 19, 2024
ac15fc8
go.mod: uprade hostd dependency
ChrisSchinnerl Feb 19, 2024
0ed4313
stores: fix TestPartialSlab
ChrisSchinnerl Feb 19, 2024
d7a51d2
stores: fix TestSQLMetadataStore
ChrisSchinnerl Feb 19, 2024
3990ece
stores: fix TestObjectBasic
ChrisSchinnerl Feb 19, 2024
f075c0c
stores: TestObjectMetadata
ChrisSchinnerl Feb 19, 2024
9fcbe97
worker: only upload a single packed slab synchronously
peterjan Feb 19, 2024
812bf95
Merge pull request #979 from SiaFoundation/chris/upgrade-hostd
ChrisSchinnerl Feb 19, 2024
2756576
worker: use background context for unlocking accounts
peterjan Feb 19, 2024
2102b91
ci: add Test Stores - MySQL
peterjan Feb 19, 2024
d7e0cf5
testing: fix TestS3MultipartUploads
ChrisSchinnerl Feb 19, 2024
267d5b3
Merge pull request #969 from SiaFoundation/pj/metric-migrations
ChrisSchinnerl Feb 19, 2024
361c6cf
stores: add index to object size
ChrisSchinnerl Feb 19, 2024
df94b1b
Merge pull request #983 from SiaFoundation/chris/objects-size-idx
ChrisSchinnerl Feb 20, 2024
9bb5972
stores: migration code
ChrisSchinnerl Feb 20, 2024
1f00422
stores: call pruneSlabs every time an object or multipart object were…
ChrisSchinnerl Feb 20, 2024
671f8da
stores: add migration to performMigrations
ChrisSchinnerl Feb 20, 2024
2fbcc26
worker: use different context in scanHost
ChrisSchinnerl Feb 20, 2024
0a23dea
stores: fix TestSlabCleanupTrigger
ChrisSchinnerl Feb 20, 2024
50c201a
stores: adapt unit tests to MySQL
peterjan Feb 19, 2024
e8c5c92
ci: enable all tests
peterjan Feb 20, 2024
96d4bba
stores: only drop triggers if they exist
ChrisSchinnerl Feb 20, 2024
4cb5efa
worker: address review comment
ChrisSchinnerl Feb 20, 2024
c0d92cf
Merge pull request #974 from SiaFoundation/chris/multipart-create-key
ChrisSchinnerl Feb 20, 2024
9cdcd60
Merge pull request #970 from SiaFoundation/chris/optimise-stats-bucket
ChrisSchinnerl Feb 20, 2024
adafec0
stores: add missing newline
ChrisSchinnerl Feb 20, 2024
c346017
bus: change response type for paginated alerts request
ChrisSchinnerl Feb 20, 2024
ce3e692
bus: revert dismissall alerts endpoint
ChrisSchinnerl Feb 20, 2024
1198034
worker: don't register alert for cancelled download
ChrisSchinnerl Feb 20, 2024
69bde06
worker: don't register download error alert for errDownloadCancelled …
ChrisSchinnerl Feb 21, 2024
709acfe
bus: fix japecheck
ChrisSchinnerl Feb 21, 2024
aacaaa7
stores: remove frand.Shuffle
peterjan Feb 22, 2024
414090b
stores: change bCurrency type to BigEndian (#991)
ChrisSchinnerl Feb 22, 2024
7fb1349
Merge branch 'dev' of github.com:SiaFoundation/renterd into pj/mysql-…
peterjan Feb 22, 2024
9edb677
Merge pull request #982 from SiaFoundation/pj/mysql-stores-tests
ChrisSchinnerl Feb 22, 2024
c29adb0
Merge pull request #986 from SiaFoundation/chris/remove-interaction-r…
ChrisSchinnerl Feb 22, 2024
b5d2c4f
Merge pull request #972 from SiaFoundation/chris/only-metadata
ChrisSchinnerl Feb 22, 2024
302aaa4
Merge pull request #988 from SiaFoundation/chris/download-cancel-alert
ChrisSchinnerl Feb 22, 2024
5b968e7
stores: numDeleted
ChrisSchinnerl Feb 22, 2024
fb5bc35
worker: add benchmarks for upload through uploader
ChrisSchinnerl Feb 21, 2024
e1d45a4
worker: add benchmark results
ChrisSchinnerl Feb 21, 2024
fd166d8
worker: docstring update
ChrisSchinnerl Feb 21, 2024
9f27c17
worker: remove hash reader
ChrisSchinnerl Feb 21, 2024
24fb81a
worker: update benchmark result
ChrisSchinnerl Feb 21, 2024
11d0152
worker: encrypt using multiple goroutines
ChrisSchinnerl Feb 21, 2024
c918925
worker: update benchmark results
ChrisSchinnerl Feb 21, 2024
5ceccfc
worker: ComputeEtag method
ChrisSchinnerl Feb 22, 2024
cfb8cb6
worker: pass expected root to UploadSector
ChrisSchinnerl Feb 22, 2024
67a6c87
worker: update benchmark results
ChrisSchinnerl Feb 22, 2024
3f11ef6
worker: implement PR remarks
peterjan Feb 22, 2024
2827f0d
worker: simplify tryUploadPackedSlab
peterjan Feb 22, 2024
42b09af
worker: revert SlabSize rename
peterjan Feb 22, 2024
bcdeb0d
worker: return err
peterjan Feb 22, 2024
8dc97a5
Merge branch 'dev' of github.com:SiaFoundation/renterd into pj/fix-pa…
peterjan Feb 22, 2024
5ec6f36
worker: remove interaction recorder
peterjan Feb 22, 2024
542709a
Merge pull request #981 from SiaFoundation/pj/use-background-context-…
ChrisSchinnerl Feb 22, 2024
aa29aff
testing: fix TestUploadPacking
peterjan Feb 22, 2024
9af03a3
worker: add BenchmarkDownloaderSingleObjecdt
ChrisSchinnerl Feb 22, 2024
c9dc1b6
worker: decrypt in parallel
ChrisSchinnerl Feb 22, 2024
aa08202
worker: update download benchmark results
ChrisSchinnerl Feb 22, 2024
29f4201
worker: remove irrelevant benchmarks
ChrisSchinnerl Feb 22, 2024
01805e6
Merge branch 'dev' into chris/prune-slabs-cascade
ChrisSchinnerl Feb 22, 2024
10e88fd
stores: fix mysql migration
ChrisSchinnerl Feb 22, 2024
3e92f08
ui: v0.46.0
ChrisSchinnerl Feb 23, 2024
1192264
Merge pull request #987 from SiaFoundation/chris/alerts-pagination
ChrisSchinnerl Feb 23, 2024
99014c7
stores: drop indices first
ChrisSchinnerl Feb 23, 2024
72557ad
Merge pull request #985 from SiaFoundation/chris/prune-slabs-cascade
ChrisSchinnerl Feb 23, 2024
42338c7
Merge pull request #994 from SiaFoundation/ui/update
ChrisSchinnerl Feb 23, 2024
89b4729
testing: fix TestUploadPacking
ChrisSchinnerl Feb 23, 2024
b45b80f
autopilot: accumulate churn information into single alert
ChrisSchinnerl Feb 21, 2024
c17252a
autopilot: update churn alert to contain timestamp
ChrisSchinnerl Feb 23, 2024
e9a593d
bus: only log lost sectors when there was a contract with that host
ChrisSchinnerl Feb 23, 2024
3f09191
Merge pull request #989 from SiaFoundation/chris/churn-alert-accumulator
ChrisSchinnerl Feb 23, 2024
9e02505
build(deps): bump go.sia.tech/coreutils from 0.0.1 to 0.0.3
dependabot[bot] Feb 26, 2024
b1efe2c
build(deps): bump go.uber.org/zap from 1.26.0 to 1.27.0
dependabot[bot] Feb 26, 2024
08f0084
worker: add testWorker
peterjan Feb 26, 2024
59d7964
Merge branch 'dev' of github.com:SiaFoundation/renterd into pj/mock-bus
peterjan Feb 26, 2024
8baca5b
worker: fix lint
peterjan Feb 26, 2024
145b505
worker: extend test worker with a way to block uploads
peterjan Feb 26, 2024
6866e11
Merge pull request #999 from SiaFoundation/dependabot/go_modules/go.u…
ChrisSchinnerl Feb 27, 2024
97b017e
Merge pull request #998 from SiaFoundation/dependabot/go_modules/go.s…
ChrisSchinnerl Feb 27, 2024
12c5dda
Merge branch 'dev' of github.com:SiaFoundation/renterd into pj/fix-pa…
peterjan Feb 27, 2024
8ca4580
Merge branch 'pj/mock-bus' into pj/fix-packed-slab-uploads
peterjan Feb 27, 2024
0ef1757
bus: filter by alert severity
ChrisSchinnerl Feb 27, 2024
75451b0
Merge pull request #990 from SiaFoundation/chris/upload-benchmark
ChrisSchinnerl Feb 27, 2024
b7e14e8
stores: check for exact value in TestDeleteHostSector
ChrisSchinnerl Feb 27, 2024
fc72fa9
Merge pull request #996 from SiaFoundation/chris/mark-sector-lost-log…
ChrisSchinnerl Feb 27, 2024
716091b
worker: extend TestUploadPackedSlab to test sync and async packed sla…
peterjan Feb 27, 2024
de4b8c8
Merge branch 'dev' of github.com:SiaFoundation/renterd into pj/mock-bus
peterjan Feb 27, 2024
04de30b
Merge branch 'pj/mock-bus' into pj/fix-packed-slab-uploads
peterjan Feb 27, 2024
7c5b3c9
bus: breakdown totals
ChrisSchinnerl Feb 27, 2024
6db1e38
Update alerts/alerts.go
ChrisSchinnerl Feb 27, 2024
fc3625a
Merge pull request #1002 from SiaFoundation/chris/alerts-filter-severity
ChrisSchinnerl Feb 27, 2024
0fceed1
api: fix Object response type
ChrisSchinnerl Feb 27, 2024
f29534a
object: add docstring to Object type
ChrisSchinnerl Feb 27, 2024
a704e9f
testing: add testutils package
peterjan Feb 27, 2024
3a15760
worker: expose methods
peterjan Feb 27, 2024
c009296
Merge pull request #1004 from SiaFoundation/chris/fix-object-json
ChrisSchinnerl Feb 27, 2024
31198ab
testing: move tt.go
peterjan Feb 27, 2024
30ced3e
ci: update test.yml
peterjan Feb 27, 2024
dda5af9
Merge branch 'dev' of github.com:SiaFoundation/renterd into pj/mock-bus
peterjan Feb 27, 2024
dfc7850
ci: fix e2e path
peterjan Feb 27, 2024
990feac
internal: rename TT constr
peterjan Feb 27, 2024
9798d64
testing: add config.go
peterjan Feb 27, 2024
d277a7e
Merge branch 'pj/mock-bus' into pj/fix-packed-slab-uploads
peterjan Feb 27, 2024
c956182
worker: use frand.Bytes
peterjan Feb 27, 2024
448fd4f
stores: update findAggregatedContractPeriods to fetch individual cont…
ChrisSchinnerl Feb 27, 2024
a32cd3b
stores: add migrations
ChrisSchinnerl Feb 28, 2024
82f1f5d
stores: add contractMetricGranularity
ChrisSchinnerl Feb 28, 2024
7db0f92
stores: fix syntax error
ChrisSchinnerl Feb 28, 2024
017c775
autopilot: fix json key casing
peterjan Feb 28, 2024
54874de
Merge pull request #1007 from SiaFoundation/pj/fix-alert-prop-cc
ChrisSchinnerl Feb 28, 2024
91ab508
worker: ignore ErrUploadInterrupted when registering upload failure a…
ChrisSchinnerl Feb 28, 2024
1771e41
Merge pull request #1008 from SiaFoundation/chris/alert-upload-interr…
ChrisSchinnerl Feb 28, 2024
e031cf4
Merge pull request #1000 from SiaFoundation/pj/mock-bus
ChrisSchinnerl Feb 28, 2024
1ef39bc
Merge pull request #980 from SiaFoundation/pj/fix-packed-slab-uploads
ChrisSchinnerl Feb 28, 2024
75afd56
Update stores/metrics.go
ChrisSchinnerl Feb 29, 2024
5e4aaab
autopilot: reduce logger noise
peterjan Feb 29, 2024
65f16ff
Merge pull request #1006 from SiaFoundation/chris/aggregate-contract-…
ChrisSchinnerl Feb 29, 2024
54cd3f9
autoilot: implement MR remarks
peterjan Feb 29, 2024
f0cbd63
Create codeql.yml
ChrisSchinnerl Feb 29, 2024
c947309
stores: fix deadlock in RefreshHealth
ChrisSchinnerl Feb 28, 2024
8aa3fe3
stores: separate query for MySQL
ChrisSchinnerl Feb 28, 2024
d320125
stores: change UpdateSlab to update slab first
ChrisSchinnerl Feb 28, 2024
96bb6ef
autopilot: fix error check
peterjan Feb 29, 2024
445e33b
autopilot: add endpoint for evaluating autopilot configuration
ChrisSchinnerl Feb 23, 2024
4a00604
autopilot: optmiseGougingSetting
ChrisSchinnerl Feb 29, 2024
85141d3
Merge pull request #1009 from SiaFoundation/chris/refresh-health-lockup
ChrisSchinnerl Feb 29, 2024
ec4329d
autopilot: return recommendation for config
ChrisSchinnerl Feb 29, 2024
59f11ad
e2e: extend TestGouging
ChrisSchinnerl Feb 29, 2024
a10da6f
Merge pull request #1011 from SiaFoundation/pj/improve-ap-logger-noise
ChrisSchinnerl Feb 29, 2024
051f386
ui: v0.49.0
alexfreska Mar 2, 2024
1d12039
build(deps): bump golang.org/x/crypto from 0.19.0 to 0.20.0
dependabot[bot] Mar 4, 2024
6952367
build(deps): bump github.com/minio/minio-go/v7 from 7.0.67 to 7.0.68
dependabot[bot] Mar 4, 2024
cce9d22
stores: improve locking for deleting multipart uploads in parallel
ChrisSchinnerl Mar 4, 2024
bba8887
Merge pull request #1016 from SiaFoundation/ui/update
ChrisSchinnerl Mar 4, 2024
e59a411
Merge pull request #1020 from SiaFoundation/dependabot/go_modules/gol…
ChrisSchinnerl Mar 4, 2024
de431b6
Merge pull request #1021 from SiaFoundation/dependabot/go_modules/git…
ChrisSchinnerl Mar 4, 2024
3c7e42f
stores: fix TestS3MultipartUploads
ChrisSchinnerl Mar 4, 2024
798dd31
main: print address when generating new seed to match hostd behaviour
ChrisSchinnerl Mar 4, 2024
ba9e7fc
stores: fix MultipartUploads order of returned uploads
ChrisSchinnerl Mar 4, 2024
bc5251d
autopilot: address review comments
ChrisSchinnerl Mar 4, 2024
fa4e796
stores: update RefreshHealth query and add unit test
peterjan Mar 4, 2024
cb73ef0
stores: fix TestRefreshHealth for MySQL test suite
peterjan Mar 4, 2024
a6b5049
worker: fix host height gouging when price table has expiry far in th…
ChrisSchinnerl Mar 4, 2024
1bed43a
autopilot: introduce smallestValidScore
ChrisSchinnerl Mar 5, 2024
7bbafb0
e2e: fix TestGouging
ChrisSchinnerl Mar 5, 2024
7f7b76b
Merge pull request #1028 from SiaFoundation/chris/price-table-expiry-…
ChrisSchinnerl Mar 5, 2024
e09f7ca
worker: fix TestUploadPackedSlab NDF
peterjan Feb 29, 2024
b3ca95d
Merge pull request #1027 from SiaFoundation/pj/fix-refresh-health
ChrisSchinnerl Mar 5, 2024
95f052f
Merge pull request #1023 from SiaFoundation/chris/print-wallet-address
ChrisSchinnerl Mar 5, 2024
43b2c47
Merge pull request #1025 from SiaFoundation/chris/fix-multipart-uploads
ChrisSchinnerl Mar 5, 2024
13351a5
Merge pull request #1022 from SiaFoundation/chris/abort-multipart-upl…
ChrisSchinnerl Mar 5, 2024
e320494
testing: remove named return var
peterjan Mar 5, 2024
64a2788
worker: improve logging when scanning hosts
ChrisSchinnerl Mar 5, 2024
f51fc98
worker: add HEAD object endpoint
peterjan Mar 5, 2024
906bcc8
worker: updat error message
peterjan Mar 5, 2024
fcf1c85
Merge pull request #1012 from SiaFoundation/pj/fix-packed-slab-ndf
ChrisSchinnerl Mar 6, 2024
991d89d
e2e: address review comment
ChrisSchinnerl Mar 6, 2024
49c725c
bus: do not broadcast empty txn sets
peterjan Mar 6, 2024
7f0cf5c
worker: address comments
ChrisSchinnerl Mar 6, 2024
dd8cb8a
e2e: fix TestBlocklist
ChrisSchinnerl Mar 6, 2024
9ee22c8
Merge pull request #995 from SiaFoundation/chris/evaluate-config
ChrisSchinnerl Mar 6, 2024
31cad9f
stores: migration to update object health to 1 when size is 0
ChrisSchinnerl Mar 6, 2024
1c496f7
stores: extend TestRefreshHealth
ChrisSchinnerl Mar 6, 2024
e4e5a8e
stores: add migration to performMigrations
ChrisSchinnerl Mar 6, 2024
2a39168
fix typos
omahs Mar 6, 2024
362b45c
fix typo
omahs Mar 6, 2024
dca23dc
Merge branch 'dev' into chris/scan-logging
ChrisSchinnerl Mar 6, 2024
1b0bd3b
e2e: TestHostScan
ChrisSchinnerl Mar 6, 2024
ee4d925
e2e: update comment in TestHostScan
ChrisSchinnerl Mar 6, 2024
78769d2
e2e: run check in retry
ChrisSchinnerl Mar 6, 2024
e4ab18a
e2e: sleep before scan
ChrisSchinnerl Mar 6, 2024
e9ba938
worker: implement CR remarks
peterjan Mar 6, 2024
7a89292
Merge pull request #1038 from omahs/patch-1
ChrisSchinnerl Mar 6, 2024
79f6d66
Merge pull request #1029 from SiaFoundation/chris/scan-logging
ChrisSchinnerl Mar 7, 2024
3e0bb06
Merge pull request #1037 from SiaFoundation/chris/zero-size-object-he…
ChrisSchinnerl Mar 7, 2024
b93b771
Merge branch 'dev' into pj/fix-redistribute-empty-txn
ChrisSchinnerl Mar 7, 2024
968dc1c
e2e: gofmt
ChrisSchinnerl Mar 7, 2024
55dcdfc
Merge pull request #1035 from SiaFoundation/pj/fix-redistribute-empty…
ChrisSchinnerl Mar 7, 2024
bfc9feb
Merge pull request #1030 from SiaFoundation/pj/object-head
ChrisSchinnerl Mar 7, 2024
0dce4f4
Merge branch 'master' into chris/merge-master
ChrisSchinnerl Mar 7, 2024
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
84 changes: 84 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "dev", "master" ]
pull_request:
branches: [ "dev", "master" ]
schedule:
- cron: '22 22 * * 4'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,20 @@ jobs:
uses: n8maninger/action-golang-test@v1
with:
args: "-race;-short"
- name: Test Stores - MySQL
if: matrix.os == 'ubuntu-latest'
uses: n8maninger/action-golang-test@v1
env:
RENTERD_DB_URI: 127.0.0.1:3800
RENTERD_DB_USER: root
RENTERD_DB_PASSWORD: test
with:
package: "./stores"
args: "-race;-short"
- name: Test Integration
uses: n8maninger/action-golang-test@v1
with:
package: "./internal/testing/..."
package: "./internal/test/e2e/..."
args: "-failfast;-race;-tags=testing;-timeout=30m"
- name: Test Integration - MySQL
if: matrix.os == 'ubuntu-latest'
Expand All @@ -60,7 +70,7 @@ jobs:
RENTERD_DB_USER: root
RENTERD_DB_PASSWORD: test
with:
package: "./internal/testing/..."
package: "./internal/test/e2e/..."
args: "-failfast;-race;-tags=testing;-timeout=30m"
- name: Build
run: go build -o bin/ ./cmd/renterd
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ setting does not have a default value, it can be updated using the settings API:

In most cases the default set should match the set from your autopilot
configuration in order for migrations to work properly. The contract set can be
overriden by passing it as a query string parameter to the worker's upload and
overridden by passing it as a query string parameter to the worker's upload and
migrate endpoints.

- `PUT /api/worker/objects/foo?contractset=foo`

### Redundancy

The default redundancy on mainnet is 30-10, on testnet it is 6-2. The redunancy
The default redundancy on mainnet is 30-10, on testnet it is 6-2. The redundancy
can be updated using the settings API:

- `GET /api/bus/setting/redundancy`
Expand Down
83 changes: 70 additions & 13 deletions alerts/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (

type (
Alerter interface {
Alerts(_ context.Context, opts AlertsOpts) (resp AlertsResponse, err error)
RegisterAlert(_ context.Context, a Alert) error
DismissAlerts(_ context.Context, ids ...types.Hash256) error
}
Expand Down Expand Up @@ -63,8 +64,29 @@ type (
alerts map[types.Hash256]Alert
webhookBroadcaster webhooks.Broadcaster
}

AlertsOpts struct {
Offset int
Limit int
Severity Severity
}

AlertsResponse struct {
Alerts []Alert `json:"alerts"`
HasMore bool `json:"hasMore"`
Totals struct {
Info int `json:"info"`
Warning int `json:"warning"`
Error int `json:"error"`
Critical int `json:"critical"`
} `json:"totals"`
}
)

func (ar AlertsResponse) Total() int {
return ar.Totals.Info + ar.Totals.Warning + ar.Totals.Error + ar.Totals.Critical
}

// String implements the fmt.Stringer interface.
func (s Severity) String() string {
switch s {
Expand All @@ -81,15 +103,8 @@ func (s Severity) String() string {
}
}

// MarshalJSON implements the json.Marshaler interface.
func (s Severity) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`%q`, s.String())), nil
}

// UnmarshalJSON implements the json.Unmarshaler interface.
func (s *Severity) UnmarshalJSON(b []byte) error {
status := strings.Trim(string(b), `"`)
switch status {
func (s *Severity) LoadString(str string) error {
switch str {
case severityInfoStr:
*s = SeverityInfo
case severityWarningStr:
Expand All @@ -99,11 +114,21 @@ func (s *Severity) UnmarshalJSON(b []byte) error {
case severityCriticalStr:
*s = SeverityCritical
default:
return fmt.Errorf("unrecognized severity: %v", status)
return fmt.Errorf("unrecognized severity: %v", str)
}
return nil
}

// MarshalJSON implements the json.Marshaler interface.
func (s Severity) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`%q`, s.String())), nil
}

// UnmarshalJSON implements the json.Unmarshaler interface.
func (s *Severity) UnmarshalJSON(b []byte) error {
return s.LoadString(strings.Trim(string(b), `"`))
}

// RegisterAlert implements the Alerter interface.
func (m *Manager) RegisterAlert(ctx context.Context, alert Alert) error {
if alert.ID == (types.Hash256{}) {
Expand Down Expand Up @@ -158,19 +183,46 @@ func (m *Manager) DismissAlerts(ctx context.Context, ids ...types.Hash256) error
})
}

// Active returns the host's active alerts.
func (m *Manager) Active() []Alert {
// Alerts returns the host's active alerts.
func (m *Manager) Alerts(_ context.Context, opts AlertsOpts) (AlertsResponse, error) {
m.mu.Lock()
defer m.mu.Unlock()

offset, limit := opts.Offset, opts.Limit
resp := AlertsResponse{}

if offset >= len(m.alerts) {
return resp, nil
} else if limit == -1 {
limit = len(m.alerts)
}

alerts := make([]Alert, 0, len(m.alerts))
for _, a := range m.alerts {
if a.Severity == SeverityInfo {
resp.Totals.Info++
} else if a.Severity == SeverityWarning {
resp.Totals.Warning++
} else if a.Severity == SeverityError {
resp.Totals.Error++
} else if a.Severity == SeverityCritical {
resp.Totals.Critical++
}
if opts.Severity != 0 && a.Severity != opts.Severity {
continue // filter by severity
}
alerts = append(alerts, a)
}
sort.Slice(alerts, func(i, j int) bool {
return alerts[i].Timestamp.After(alerts[j].Timestamp)
})
return alerts
alerts = alerts[offset:]
if limit < len(alerts) {
alerts = alerts[:limit]
resp.HasMore = true
}
resp.Alerts = alerts
return resp, nil
}

func (m *Manager) RegisterWebhookBroadcaster(b webhooks.Broadcaster) {
Expand Down Expand Up @@ -204,6 +256,11 @@ func WithOrigin(alerter Alerter, origin string) Alerter {
}
}

// Alerts implements the Alerter interface.
func (a *originAlerter) Alerts(ctx context.Context, opts AlertsOpts) (resp AlertsResponse, err error) {
return a.alerter.Alerts(ctx, opts)
}

// RegisterAlert implements the Alerter interface.
func (a *originAlerter) RegisterAlert(ctx context.Context, alert Alert) error {
if alert.Data == nil {
Expand Down
32 changes: 30 additions & 2 deletions api/autopilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,37 @@ type (
StartTime TimeRFC3339 `json:"startTime"`
BuildState
}
)

type (
ConfigEvaluationRequest struct {
AutopilotConfig AutopilotConfig `json:"autopilotConfig"`
GougingSettings GougingSettings `json:"gougingSettings"`
RedundancySettings RedundancySettings `json:"redundancySettings"`
}

ConfigRecommendation struct {
GougingSettings GougingSettings `json:"gougingSettings"`
}

// ConfigEvaluationResponse is the response type for /evaluate
ConfigEvaluationResponse struct {
Hosts uint64 `json:"hosts"`
Usable uint64 `json:"usable"`
Unusable struct {
Blocked uint64 `json:"blocked"`
Gouging struct {
Contract uint64 `json:"contract"`
Download uint64 `json:"download"`
Gouging uint64 `json:"gouging"`
Pruning uint64 `json:"pruning"`
Upload uint64 `json:"upload"`
} `json:"gouging"`
NotAcceptingContracts uint64 `json:"notAcceptingContracts"`
NotScanned uint64 `json:"notScanned"`
Unknown uint64 `json:"unknown"`
}
Recommendation *ConfigRecommendation `json:"recommendation,omitempty"`
}

// HostHandlerResponse is the response type for the /host/:hostkey endpoint.
HostHandlerResponse struct {
Host hostdb.Host `json:"host"`
Expand Down
2 changes: 1 addition & 1 deletion api/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ func (opts HostsForScanningOptions) Apply(values url.Values) {
values.Set("limit", fmt.Sprint(opts.Limit))
}
if !opts.MaxLastScan.IsZero() {
values.Set("maxLastScan", fmt.Sprint(TimeRFC3339(opts.MaxLastScan)))
values.Set("lastScan", fmt.Sprint(TimeRFC3339(opts.MaxLastScan)))
}
}
21 changes: 13 additions & 8 deletions api/multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ type (
}

CreateMultipartOptions struct {
Key object.EncryptionKey
MimeType string
Metadata ObjectUserMetadata
GenerateKey bool
Key *object.EncryptionKey
MimeType string
Metadata ObjectUserMetadata
}
)

Expand Down Expand Up @@ -81,11 +82,15 @@ type (
}

MultipartCreateRequest struct {
Bucket string `json:"bucket"`
Path string `json:"path"`
Key object.EncryptionKey `json:"key"`
MimeType string `json:"mimeType"`
Metadata ObjectUserMetadata `json:"metadata"`
Bucket string `json:"bucket"`
Path string `json:"path"`
Key *object.EncryptionKey `json:"key"`
MimeType string `json:"mimeType"`
Metadata ObjectUserMetadata `json:"metadata"`

// TODO: The next major version change should invert this to create a
// key by default
GenerateKey bool `json:"generateKey"`
}

MultipartCreateResponse struct {
Expand Down
Loading
Loading