Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
7485d1b
Update dockerfile for pos
Dec 13, 2023
48fa9ab
Merge branch 'main' into feature/proof-of-stake
tholonious Feb 9, 2024
3e16391
Merge updated core and backend imports
tholonious Feb 9, 2024
02e614c
Add StakeEntry, LockedStakeEntry, and ValidatorEntry. Update Dockerfi…
Dec 13, 2023
fdf5042
Merge pull request #5 from deso-protocol/add-pos-types
lazynina Feb 16, 2024
8840576
Add new fields to block and transaction that are introduced w/ pos
lazynina Feb 1, 2024
d04a6ee
Merge pull request #9 from deso-protocol/update-block-and-txn-based-o…
lazynina Feb 16, 2024
c3dc795
Add LeaderScheduleEntry
lazynina Feb 15, 2024
83c472d
Add LeaderScheduleEntry
lazynina Feb 15, 2024
60c44ed
Merge pull request #12 from deso-protocol/leader-schedule
lazynina Feb 16, 2024
6c6ee96
Store current global params
lazynina Feb 20, 2024
1db43b1
Merge pull request #13 from deso-protocol/global-params
lazynina Feb 20, 2024
a628f55
Remove ProposerPublicKey and add bls key mapping
lazynina Feb 20, 2024
9009daf
Remove ProposerPublicKey and add bls key mapping (#14)
lazynina Feb 26, 2024
d982f3f
Jailed History
lazynina Feb 19, 2024
aca414a
Jailed History (#15)
lazynina Feb 26, 2024
00b395e
Add views for pos and snapshot bls public keys
lazynina Feb 26, 2024
251f085
Add views for pos and snapshot bls public keys (#16)
lazynina Feb 26, 2024
4ad1ec1
Human readable reward method
lazynina Feb 27, 2024
f5e7148
Merge pull request #17 from deso-protocol/human-readable-reward-method
lazynina Feb 27, 2024
2497fd0
add unique constraint to stake summary view
jackson-dean Feb 27, 2024
ebec143
Add num stakers to staking summary
lazynina Feb 28, 2024
9a05ee5
Merge pull request #19 from deso-protocol/add-num-stakers-to-staking-…
lazynina Feb 28, 2024
466265a
Always compute if txn connects in utxo operation
lazynina Feb 27, 2024
472b615
Merge pull request #18 from deso-protocol/failing-txn-support-utxo-ops
lazynina Feb 28, 2024
df6e6e9
Fix pg tag for SnapshotAtEpochNumber in BLSPublicKeyPKIDPairSnapshotE…
lazynina Feb 29, 2024
9397f34
Merge pull request #21 from deso-protocol/fix-pg-tag-for-snapshot-at-…
lazynina Mar 1, 2024
781bd99
Fix validator stats rank
lazynina Mar 1, 2024
ded0c6b
Merge pull request #22 from deso-protocol/fix-validator-stats-rank
lazynina Mar 1, 2024
7e72b6e
fix rank in validator_stats view
lazynina Mar 1, 2024
00b5358
Merge pull request #23 from deso-protocol/fix-validator-stats-update-…
lazynina Mar 1, 2024
c35a68b
Update flow crypto
lazynina Mar 19, 2024
02f673c
Merge pull request #24 from deso-protocol/update-flow-crypto
lazynina Mar 21, 2024
8bdae0a
Remove relic build tag in block.go
lazynina Mar 21, 2024
211c73d
Merge pull request #25 from deso-protocol/remove-relic-build-tag-in-b…
lazynina Mar 21, 2024
6e30bdc
Fix HodlerPKID on LockedBalanceEntry
lazynina Mar 27, 2024
8136c3a
Merge pull request #26 from deso-protocol/patch-hodler-pkid-on-lockups
lazynina Mar 27, 2024
7c16d02
Patch lockup yield curve point
lazynina Mar 27, 2024
b8945c2
Merge pull request #27 from deso-protocol/patch-yield-curve-point
lazynina Mar 27, 2024
22592bf
Remove failing txn logic
lazynina Mar 29, 2024
17b03f8
Merge pull request #28 from deso-protocol/feature/pos-mempool-updates…
lazynina Mar 29, 2024
62c892c
Update global params based on latest in core
lazynina Apr 4, 2024
33c051a
Merge pull request #29 from deso-protocol/update-global-params-04-04-24
lazynina Apr 4, 2024
a04f38d
Upgrade go version
lazynina Apr 8, 2024
582d166
Upgrade go version (#30)
lazynina Apr 11, 2024
1a9baa6
Upgrade deps
lazynina Apr 8, 2024
0c89832
Upgrade deps (#31)
lazynina Apr 11, 2024
e186b65
Add InitialLeaderIndexOffset to EpochEntry Postgres Type (#34)
tholonious Apr 11, 2024
3f55bf2
Add partition for atomic txns
lazynina Apr 16, 2024
a1ac441
Merge pull request #35 from deso-protocol/atomic-txn-partition
lazynina Apr 16, 2024
5113a3e
Update latest block height every 100 milliseconds
lazynina Apr 17, 2024
cf595e3
Merge pull request #36 from deso-protocol/refresh-latest-block-height…
lazynina Apr 17, 2024
03bc7b9
delete utxo ops on inner txn's txindexmetadata
lazynina Apr 18, 2024
ef7e085
Merge pull request #37 from deso-protocol/delete-utxo-ops-on-atomic-t…
lazynina Apr 18, 2024
6599731
Fix upsert blocks for PoS
lazynina Apr 9, 2024
2883406
Fix upsert blocks for PoS (#33)
lazynina Apr 19, 2024
9cf48a8
Support inner txns from atomic txn wrapper
lazynina Apr 18, 2024
921aa06
Support inner txns from atomic txn wrapper (#38)
lazynina Apr 19, 2024
987eea6
trigger build
lazynina Apr 23, 2024
c69997a
don't use nullzero on bool columns
lazynina Apr 24, 2024
7a18182
Add comment on statistic_dashboard view back
lazynina Apr 26, 2024
6e4af2b
Merge pull request #43 from deso-protocol/fix-migration-dashboard-stats
lazynina Apr 26, 2024
3154c4d
Snapshot validator entries and block signers + associated views
lazynina Apr 25, 2024
433bd0a
Snapshot validator entries and block signers (#39)
lazynina Apr 29, 2024
4daddf5
Swallow txindex metadata error
lazynina Apr 26, 2024
b759a51
Swallow txindex metadata error (#41)
lazynina Apr 29, 2024
3dd7e16
Fix block signers insert
lazynina Apr 29, 2024
7283bbe
Merge pull request #45 from deso-protocol/fix-block-signers-insert
lazynina Apr 29, 2024
424c042
empty commit to trigger build
lazynina May 1, 2024
8380704
Transfer Z's changes from z/update-state-change-entry-encoder branch …
lazynina Apr 30, 2024
9a39500
Merge pull request #46 from deso-protocol/transfer-z-changes-to-pos-b…
lazynina May 1, 2024
1e6f2e5
Fix validator entry delete logic
lazynina May 2, 2024
ad828eb
Fix validator entry delete logic (#47)
lazynina May 2, 2024
a12ea99
Check length of bls pkid pair slices before deleting
lazynina May 2, 2024
ee5c3fb
Check length of bls pkid pair slices before deleting (#48)
lazynina May 2, 2024
1731446
Empty commit to trigger CI
tholonious May 16, 2024
ad81f2f
Fix bugs
superzordon May 22, 2024
4428d8a
Empty commit to trigger build
superzordon May 25, 2024
62b1ca1
Merge pull request #50 from deso-protocol/z/pos-bugfixes
superzordon May 30, 2024
5ff7bbf
Empty commit to trigger build
superzordon May 31, 2024
2cb65f0
Merge branch 'feature/proof-of-stake' of https://github.com/deso-prot…
superzordon May 31, 2024
a47a3c9
Gate additional statistic migrations.
mattfoley8 Jun 3, 2024
da971fb
Merge pull request #51 from deso-protocol/mf/gate-addtnl-statistic-mi…
mattfoley8 Jun 3, 2024
81a3960
Downgrade uint256
superzordon Jun 5, 2024
c147b27
Revert "Upgrade deps" (#52)
lazynina Jun 5, 2024
986b330
Revert "Upgrade go version (#30)" (#53)
lazynina Jun 6, 2024
4d0602b
Improve wallet view efficiency
superzordon Jun 10, 2024
e1099da
Merge pull request #54 from deso-protocol/z/update-wallet-view
superzordon Jun 10, 2024
090c5f2
Update wallet view
superzordon Jun 13, 2024
6278ac9
Merge pull request #55 from deso-protocol/z/update-wallet-view
superzordon Jun 13, 2024
aeb6aef
Empty commit to trigger build
superzordon Jun 13, 2024
6ae5775
Merge pull request #56 from deso-protocol/z/fix-post-state-change-met…
superzordon Jun 13, 2024
126afcd
Add additional indexes
superzordon Jun 13, 2024
8362727
Merge pull request #57 from deso-protocol/z/add-indexes-update-postgr…
superzordon Jun 13, 2024
b75893e
Revert migration
superzordon Jun 13, 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
49 changes: 30 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
FROM alpine:latest AS daodao
FROM alpine:latest AS postgres-data-handler

RUN apk update
RUN apk upgrade
RUN apk add --update go gcc g++ vips-dev
RUN apk add --update bash go cmake g++ gcc git make vips-dev

WORKDIR /postgres-data-handler/src

COPY postgres-data-handler/go.mod postgres-data-handler/
COPY postgres-data-handler/go.sum postgres-data-handler/
COPY core/go.mod core/
COPY core/go.sum core/
COPY core/go.mod core/
COPY core/go.sum core/
COPY backend/go.mod backend/
COPY backend/go.sum backend/
COPY state-consumer/go.mod state-consumer/
COPY state-consumer/go.sum state-consumer/

WORKDIR /postgres-data-handler/src/postgres-data-handler

RUN go mod download

# include postgres data handler src
COPY postgres-data-handler/entries entries
COPY postgres-data-handler/migrations migrations
COPY postgres-data-handler/entries entries
COPY postgres-data-handler/migrations migrations
COPY postgres-data-handler/handler handler
COPY postgres-data-handler/main.go .
COPY postgres-data-handler/main.go .

# include core src
COPY core/desohash ../core/desohash
COPY core/cmd ../core/cmd
COPY core/lib ../core/lib
COPY core/migrate ../core/migrate
COPY core/desohash ../core/desohash
COPY core/consensus ../core/consensus
COPY core/collections ../core/collections
COPY core/bls ../core/bls
COPY core/cmd ../core/cmd
COPY core/lib ../core/lib
COPY core/migrate ../core/migrate

# include backend src
COPY backend/apis ../backend/apis
COPY backend/config ../backend/config
COPY backend/cmd ../backend/cmd
COPY backend/miner ../backend/miner
COPY backend/routes ../backend/routes
COPY backend/countries ../backend/countries

# include state-consumer src
COPY state-consumer/consumer ../state-consumer/consumer

RUN go mod tidy

## build postgres data handler backend
RUN GOOS=linux go build -mod=mod -a -installsuffix cgo -o bin/postgres-data-handler main.go
#
## create tiny image
#FROM alpine:latest
##
#RUN apk add --update vips-dev
##
#COPY --from=daodao /daodao/src/daodao-backend/bin/daodao-backend /daodao/bin/daodao-backend
#ENTRYPOINT ["/daodao/bin/daodao-backend"]

ENTRYPOINT ["/postgres-data-handler/src/postgres-data-handler/bin/postgres-data-handler"]
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dev:
go run .

dev-env:
docker compose -f local.docker-compose.yml build && docker compose -f local.docker-compose.yml up

dev-env-down:
docker compose -f local.docker-compose.yml down --volumes
6 changes: 3 additions & 3 deletions entries/access_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func AccessGroupEncoderToPGStruct(accessGroupEntry *lib.AccessGroupEntry, keyByt

// PostBatchOperation is the entry point for processing a batch of post entries. It determines the appropriate handler
// based on the operation type and executes it.
func AccessGroupBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB, params *lib.DeSoParams) error {
func AccessGroupBatchOperation(entries []*lib.StateChangeEntry, db bun.IDB, params *lib.DeSoParams) error {
// We check before we call this function that there is at least one operation type.
// We also ensure before this that all entries have the same operation type.
operationType := entries[0].OperationType
Expand All @@ -69,7 +69,7 @@ func AccessGroupBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB, para
}

// bulkInsertAccessGroupEntry inserts a batch of access_group entries into the database.
func bulkInsertAccessGroupEntry(entries []*lib.StateChangeEntry, db *bun.DB, operationType lib.StateSyncerOperationType, params *lib.DeSoParams) error {
func bulkInsertAccessGroupEntry(entries []*lib.StateChangeEntry, db bun.IDB, operationType lib.StateSyncerOperationType, params *lib.DeSoParams) error {
// Track the unique entries we've inserted so we don't insert the same entry twice.
uniqueEntries := consumer.UniqueEntries(entries)
// Create a new array to hold the bun struct.
Expand All @@ -94,7 +94,7 @@ func bulkInsertAccessGroupEntry(entries []*lib.StateChangeEntry, db *bun.DB, ope
}

// bulkDeletePostEntry deletes a batch of access_group entries from the database.
func bulkDeleteAccessGroupEntry(entries []*lib.StateChangeEntry, db *bun.DB, operationType lib.StateSyncerOperationType) error {
func bulkDeleteAccessGroupEntry(entries []*lib.StateChangeEntry, db bun.IDB, operationType lib.StateSyncerOperationType) error {
// Track the unique entries we've inserted so we don't insert the same entry twice.
uniqueEntries := consumer.UniqueEntries(entries)

Expand Down
6 changes: 3 additions & 3 deletions entries/access_group_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func AccessGroupMemberEncoderToPGStruct(accessGroupMemberEntry *lib.AccessGroupM

// PostBatchOperation is the entry point for processing a batch of post entries. It determines the appropriate handler
// based on the operation type and executes it.
func AccessGroupMemberBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB, params *lib.DeSoParams) error {
func AccessGroupMemberBatchOperation(entries []*lib.StateChangeEntry, db bun.IDB, params *lib.DeSoParams) error {
// We check before we call this function that there is at least one operation type.
// We also ensure before this that all entries have the same operation type.
operationType := entries[0].OperationType
Expand All @@ -74,7 +74,7 @@ func AccessGroupMemberBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB
}

// bulkInsertAccessGroupMemberEntry inserts a batch of access_group_member entries into the database.
func bulkInsertAccessGroupMemberEntry(entries []*lib.StateChangeEntry, db *bun.DB, operationType lib.StateSyncerOperationType, params *lib.DeSoParams) error {
func bulkInsertAccessGroupMemberEntry(entries []*lib.StateChangeEntry, db bun.IDB, operationType lib.StateSyncerOperationType, params *lib.DeSoParams) error {
// Track the unique entries we've inserted so we don't insert the same entry twice.
uniqueEntries := consumer.UniqueEntries(entries)
// Create a new array to hold the bun struct.
Expand All @@ -99,7 +99,7 @@ func bulkInsertAccessGroupMemberEntry(entries []*lib.StateChangeEntry, db *bun.D
}

// bulkDeletePostEntry deletes a batch of access_group_member entries from the database.
func bulkDeleteAccessGroupMemberEntry(entries []*lib.StateChangeEntry, db *bun.DB, operationType lib.StateSyncerOperationType) error {
func bulkDeleteAccessGroupMemberEntry(entries []*lib.StateChangeEntry, db bun.IDB, operationType lib.StateSyncerOperationType) error {
// Track the unique entries we've inserted so we don't insert the same entry twice.
uniqueEntries := consumer.UniqueEntries(entries)

Expand Down
6 changes: 3 additions & 3 deletions entries/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func BalanceEntryEncoderToPGStruct(balanceEntry *lib.BalanceEntry, keyBytes []by

// PostBatchOperation is the entry point for processing a batch of post entries. It determines the appropriate handler
// based on the operation type and executes it.
func BalanceBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB, params *lib.DeSoParams) error {
func BalanceBatchOperation(entries []*lib.StateChangeEntry, db bun.IDB, params *lib.DeSoParams) error {
// We check before we call this function that there is at least one operation type.
// We also ensure before this that all entries have the same operation type.
operationType := entries[0].OperationType
Expand All @@ -63,7 +63,7 @@ func BalanceBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB, params *
}

// bulkInsertBalanceEntry inserts a batch of balance entries into the database.
func bulkInsertBalanceEntry(entries []*lib.StateChangeEntry, db *bun.DB, operationType lib.StateSyncerOperationType, params *lib.DeSoParams) error {
func bulkInsertBalanceEntry(entries []*lib.StateChangeEntry, db bun.IDB, operationType lib.StateSyncerOperationType, params *lib.DeSoParams) error {
// Track the unique entries we've inserted so we don't insert the same entry twice.
uniqueEntries := consumer.UniqueEntries(entries)
// Create a new array to hold the bun struct.
Expand All @@ -88,7 +88,7 @@ func bulkInsertBalanceEntry(entries []*lib.StateChangeEntry, db *bun.DB, operati
}

// bulkDeletePostEntry deletes a batch of balance entries from the database.
func bulkDeleteBalanceEntry(entries []*lib.StateChangeEntry, db *bun.DB, operationType lib.StateSyncerOperationType) error {
func bulkDeleteBalanceEntry(entries []*lib.StateChangeEntry, db bun.IDB, operationType lib.StateSyncerOperationType) error {
// Track the unique entries we've inserted so we don't insert the same entry twice.
uniqueEntries := consumer.UniqueEntries(entries)

Expand Down
Loading