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

It has happened #45

Merged
merged 51 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a371480
main: Anagami
lukechampine Oct 21, 2023
c2e5f15
main: Fix mining divide-by-zero
lukechampine Nov 29, 2023
f662fd5
ci: publish anagami
n8maninger Nov 29, 2023
298988b
Merge pull request #34 from SiaFoundation/nate/its-happening-workflows
n8maninger Nov 30, 2023
c29bcb7
main: Add anagami bootstrap peers
lukechampine Dec 1, 2023
d7f8b5a
main: Fix txns display bug
lukechampine Dec 1, 2023
bf4a26d
syncer: Initialize strikes map
lukechampine Dec 4, 2023
db00172
main: Add txpool command
lukechampine Dec 4, 2023
91f2d6b
main: Don't double-spend in send command
lukechampine Dec 4, 2023
351e71d
syncer: Check addBlocks err in v2 sync
lukechampine Dec 4, 2023
87ad61c
mod: Update core dependency
lukechampine Dec 4, 2023
3f77069
syncer: Fix Subnet normalization and log bans
lukechampine Dec 6, 2023
8ea4b58
main: Update bootstrap list
lukechampine Dec 10, 2023
650510b
walletutil: Don't ignore subscription errors
lukechampine Dec 10, 2023
0bba38c
syncer: Tweak logs
lukechampine Dec 10, 2023
f477395
main: Log to walletd.log by default
lukechampine Dec 11, 2023
b08e34e
main: 2nd Anagami era
lukechampine Dec 11, 2023
7667515
main: Add immature and unconfirmed to balance cmd
lukechampine Dec 11, 2023
be17160
main: Include txn fees in unconfirmed balance
lukechampine Dec 12, 2023
200ab7e
mod: Update core dependency
lukechampine Dec 12, 2023
da086c4
main: Automatically fixup consensus.db tree
lukechampine Dec 12, 2023
8baeb7b
main: Less naive mining loop
lukechampine Dec 12, 2023
c025901
main: More mining speedups
lukechampine Dec 12, 2023
e701126
main: Remove harmful sanity check
lukechampine Dec 12, 2023
4453d86
wallet: Fix relevant address handling
lukechampine Dec 15, 2023
2b1d123
mod: Update core dependency
lukechampine Dec 17, 2023
755aa3b
mod: Update core dependency
lukechampine Dec 27, 2023
de2a052
main: Automatically fixup consensus.db tree (again)
lukechampine Dec 27, 2023
c563ff1
mod: Update core dependency
lukechampine Dec 27, 2023
0677269
main: Add checkdb command
lukechampine Dec 27, 2023
9772cb8
ci: remove test step from publish
n8maninger Dec 28, 2023
c298022
ci: remove test step
n8maninger Dec 28, 2023
e3244b3
mod: Update core dependency
lukechampine Dec 30, 2023
e6393f0
mod: Update core dependency
lukechampine Dec 31, 2023
e3c12d2
mod: Update core dependency
lukechampine Jan 2, 2024
b5ffd4e
mod: Update core dependency
lukechampine Jan 3, 2024
d962ecd
mod: Update core dependency
lukechampine Jan 3, 2024
eb99414
mod: Update core dependency
lukechampine Jan 3, 2024
8d6da88
mod: Update core dependency
lukechampine Jan 3, 2024
6ea33bd
mod: Update core dependency
lukechampine Jan 4, 2024
39d73b9
mod: Update core dependency
lukechampine Jan 4, 2024
5d749b2
mod: Update core dependency
lukechampine Jan 5, 2024
9bbc596
syncer: Add resync helper
lukechampine Jan 6, 2024
b29b002
mod: Update core dependency
lukechampine Jan 7, 2024
f877848
mod: Update core dependency
lukechampine Jan 8, 2024
d7eea4c
main: Add deletev1 command
lukechampine Jan 8, 2024
8ede5d2
syncerutil: Clear expired bans before save
lukechampine Jan 9, 2024
69f23b5
mod: Update core dependency
lukechampine Jan 10, 2024
5beb023
syncer: Wait for peer goroutines before returning from (Syncer).Run
lukechampine Jan 10, 2024
9742e21
all: Refactor for coreutils
lukechampine Jan 16, 2024
4572b28
Merge branch 'master' into its-happening
lukechampine Jan 16, 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
10 changes: 5 additions & 5 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ runs:
# uses: golangci/golangci-lint-action@v3
# with:
# skip-cache: true
- name: Analyze
uses: SiaFoundation/action-golang-analysis@HEAD
with:
analyzers: |
go.sia.tech/jape.Analyzer
# - name: Analyze
# uses: SiaFoundation/action-golang-analysis@HEAD
# with:
# analyzers: |
# go.sia.tech/jape.Analyzer
- name: Test
uses: n8maninger/action-golang-test@v1
with:
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,8 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+-**'

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Test
uses: ./.github/actions/test
docker:
runs-on: ubuntu-latest
needs: [ test ]
permissions:
packages: write
contents: read
Expand Down Expand Up @@ -55,7 +43,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
build-linux:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand Down Expand Up @@ -95,7 +82,6 @@ jobs:
path: release/
build-mac:
runs-on: macos-latest
needs: [ test ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand Down Expand Up @@ -180,7 +166,6 @@ jobs:
path: release/
build-windows:
runs-on: windows-latest
needs: [ test ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand Down
5 changes: 3 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ type TxpoolTransactionsResponse struct {

// WalletBalanceResponse is the response type for /wallets/:name/balance.
type WalletBalanceResponse struct {
Siacoins types.Currency `json:"siacoins"`
Siafunds uint64 `json:"siafunds"`
Siacoins types.Currency `json:"siacoins"`
ImmatureSiacoins types.Currency `json:"immatureSiacoins"`
Siafunds uint64 `json:"siafunds"`
}

// WalletOutputsResponse is the response type for /wallets/:name/outputs.
Expand Down
4 changes: 2 additions & 2 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"testing"
"time"

"go.sia.tech/core/chain"
"go.sia.tech/core/consensus"
"go.sia.tech/core/gateway"
"go.sia.tech/core/types"
"go.sia.tech/coreutils/chain"
"go.sia.tech/coreutils/syncer"
"go.sia.tech/jape"
"go.sia.tech/walletd/api"
"go.sia.tech/walletd/internal/syncerutil"
"go.sia.tech/walletd/internal/walletutil"
"go.sia.tech/walletd/syncer"
"go.sia.tech/walletd/wallet"
"lukechampine.com/frand"
)
Expand Down
31 changes: 20 additions & 11 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"go.sia.tech/core/consensus"
"go.sia.tech/core/gateway"
"go.sia.tech/core/types"
"go.sia.tech/walletd/syncer"
"go.sia.tech/coreutils/syncer"
"go.sia.tech/walletd/wallet"
)

Expand All @@ -27,8 +27,8 @@ type (
RecommendedFee() types.Currency
PoolTransactions() []types.Transaction
V2PoolTransactions() []types.V2Transaction
AddPoolTransactions(txns []types.Transaction) error
AddV2PoolTransactions(txns []types.V2Transaction) error
AddPoolTransactions(txns []types.Transaction) (bool, error)
AddV2PoolTransactions(index types.ChainIndex, txns []types.V2Transaction) (bool, error)
UnconfirmedParents(txn types.Transaction) []types.Transaction
}

Expand All @@ -40,7 +40,7 @@ type (
Connect(addr string) (*gateway.Peer, error)
BroadcastHeader(bh gateway.BlockHeader)
BroadcastTransactionSet(txns []types.Transaction)
BroadcastV2TransactionSet(txns []types.V2Transaction)
BroadcastV2TransactionSet(index types.ChainIndex, txns []types.V2Transaction)
BroadcastV2BlockOutline(bo gateway.V2BlockOutline)
}

Expand Down Expand Up @@ -148,16 +148,19 @@ func (s *server) txpoolBroadcastHandler(jc jape.Context) {
return
}
if len(tbr.Transactions) != 0 {
if jc.Check("invalid transaction set", s.cm.AddPoolTransactions(tbr.Transactions)) != nil {
_, err := s.cm.AddPoolTransactions(tbr.Transactions)
if jc.Check("invalid transaction set", err) != nil {
return
}
s.s.BroadcastTransactionSet(tbr.Transactions)
}
if len(tbr.V2Transactions) != 0 {
if jc.Check("invalid v2 transaction set", s.cm.AddV2PoolTransactions(tbr.V2Transactions)) != nil {
index := s.cm.TipState().Index
_, err := s.cm.AddV2PoolTransactions(index, tbr.V2Transactions)
if jc.Check("invalid v2 transaction set", err) != nil {
return
}
s.s.BroadcastV2TransactionSet(tbr.V2Transactions)
s.s.BroadcastV2TransactionSet(index, tbr.V2Transactions)
}
}

Expand Down Expand Up @@ -236,17 +239,23 @@ func (s *server) walletsBalanceHandler(jc jape.Context) {
if jc.Check("couldn't load outputs", err) != nil {
return
}
var sc types.Currency
height := s.cm.TipState().Index.Height
var sc, immature types.Currency
var sf uint64
for _, sco := range scos {
sc = sc.Add(sco.SiacoinOutput.Value)
if height >= sco.MaturityHeight {
sc = sc.Add(sco.SiacoinOutput.Value)
} else {
immature = immature.Add(sco.SiacoinOutput.Value)
}
}
for _, sfo := range sfos {
sf += sfo.SiafundOutput.Value
}
jc.Encode(WalletBalanceResponse{
Siacoins: sc,
Siafunds: sf,
Siacoins: sc,
ImmatureSiacoins: immature,
Siafunds: sf,
})
}

Expand Down
Loading