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

Improved Filtering and Selection Logic for Best Tip and Tie Breaker Mechanism #80

Merged
merged 73 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
44cc705
WIP
MartinMinkov Apr 10, 2023
56860c9
feat: Fix events from multiple transactions
MartinMinkov Apr 11, 2023
1e6a797
feat: Refactor actions in the same way as events
MartinMinkov Apr 12, 2023
4a77162
feat: Add sorting methods
MartinMinkov Apr 13, 2023
c27a83d
chore: Move functions
MartinMinkov Apr 13, 2023
f6dba13
feat: Add new fields to query
MartinMinkov Apr 17, 2023
098d2eb
wip
MartinMinkov Apr 20, 2023
11e6214
Merge branch 'main' into feat/selection-algo
MartinMinkov Apr 24, 2023
59b2c27
Implement chain selection
MartinMinkov Apr 24, 2023
d35b10c
Remove unneeded types
MartinMinkov Apr 24, 2023
aad0f1b
Refactor for readability
MartinMinkov Apr 25, 2023
bfaf506
refactor(archive-node-adapter): remove select function from archive-n…
MartinMinkov Jul 27, 2023
8d9c930
feat(mina-consensus.ts): add new file to handle Mina Protocol's conse…
MartinMinkov Jul 27, 2023
02b316c
feat(archive-node-adapter): refactor events and actions into services
MartinMinkov Jul 27, 2023
34a028f
Merge branch 'main' into feat/selection-algo
MartinMinkov Jul 27, 2023
502a284
refactor: change import paths from absolute to relative for better co…
MartinMinkov Jul 27, 2023
b6effc0
feat(package.json): add typescript as a devDependency to enable TypeS…
MartinMinkov Jul 27, 2023
8c364a8
feat(Dockerfile): upgrade base image from node:14 to node:18-alpine f…
MartinMinkov Jul 27, 2023
8415204
feat: add docker-compose.dev.yml for development environment setup
MartinMinkov Jul 27, 2023
20fc77c
feat(consensus): implement first iteration of mina pos
MartinMinkov Jul 27, 2023
4362df2
refactor(mina-consensus.ts): remove unused compareHash function and c…
MartinMinkov Jul 28, 2023
3755fc0
feat(consensus): add precomputed-block.ts and run-consensus-precomput…
MartinMinkov Jul 28, 2023
d7dc9ff
feat(run-consensus-precomputed.ts): add block data output to JSON fil…
MartinMinkov Jul 28, 2023
0fcab2e
feat(run-consensus-precomputed.ts, types.ts): refactor block structur…
MartinMinkov Jul 28, 2023
45a5cc5
feat(run-compare.ts): add new file to compare TypeScript and OCaml files
MartinMinkov Jul 28, 2023
6294d0c
docs(run-compare.ts): add usage comment at the top of the file to gui…
MartinMinkov Jul 31, 2023
34131fc
feat(consensus): add run-compare.ts and run-consensus-precomputed.ts …
MartinMinkov Jul 31, 2023
c951879
feat(run-compare.ts): add environment variables for TypeScript and OC…
MartinMinkov Jul 31, 2023
3ce60ac
feat(scripts): add download_precomputed.sh script to download and fil…
MartinMinkov Jul 31, 2023
ba52030
refactor(archive-node-adapter/utils.ts): extract unique event id crea…
MartinMinkov Aug 14, 2023
ab79ef6
refactor(mina-consensus.ts, utils.ts): move findAllIndexes function f…
MartinMinkov Aug 14, 2023
e3ce297
refactor(actions-service.ts, events-service.ts): simplify async funct…
MartinMinkov Aug 14, 2023
d8ed0b4
refactor(types.ts): simplify BlocksWithTransactionsMap type definitio…
MartinMinkov Aug 14, 2023
4757442
refactor(actions-service.ts): rename getActions to getActionData and …
MartinMinkov Aug 14, 2023
316bb7d
feat(actions-service.ts): add getActions method to handle empty actio…
MartinMinkov Aug 14, 2023
e5d3206
refactor(utils.ts): remove unused postgres import to clean up code
MartinMinkov Aug 14, 2023
76cbdb0
refactor(archive-node-adapter): remove unnecessary comments and redun…
MartinMinkov Aug 14, 2023
19a659e
refactor(events-service.ts): rename deriveEventsFromBlocks to blocksT…
MartinMinkov Aug 14, 2023
0fef6b6
refactor(utils.ts): remove sortParitionedBlocks function to improve p…
MartinMinkov Aug 14, 2023
878916c
refactor(types.ts): rename Transaction type to Transactions for bette…
MartinMinkov Aug 14, 2023
da4f9e7
refactor(actions-service.ts): rename blockMapEntries to blockTransact…
MartinMinkov Aug 14, 2023
ea1d727
refactor(utils.ts): remove type assertions and add explicit return ty…
MartinMinkov Aug 14, 2023
93a2735
feat(mina-consensus.ts): import and use config for subWindowsPerWindo…
MartinMinkov Aug 15, 2023
90b31ca
feat(consensus): add new config.ts file to handle consensus configura…
MartinMinkov Aug 16, 2023
17783bc
chore: remove console.log statements from events-service.ts and archi…
MartinMinkov Aug 16, 2023
c7294df
feat(consensus): Download consensus file and move tests
MartinMinkov Aug 16, 2023
eb5474b
feat(tsconfig.json): include 'tests/consensus/**/*' in tsconfig.json …
MartinMinkov Aug 16, 2023
89536d3
feat(config.ts): add path module to handle file paths in a cross-plat…
MartinMinkov Aug 16, 2023
59971af
feat(utils.ts): enhance removeRedundantEmittedFields function to hand…
MartinMinkov Aug 16, 2023
5f6403f
feat(tests): fix tests with big refactor
MartinMinkov Aug 16, 2023
05fa04b
feat(project): refactor project structure
MartinMinkov Aug 17, 2023
a6d76e5
refactor(utils.test.ts): move utils import path from 'db/archive-node…
MartinMinkov Aug 17, 2023
0232545
refactor(generate_mock_data.ts): update import paths for queries and …
MartinMinkov Aug 17, 2023
21a70db
feat(package.json): add 'clean' script to remove build directory for …
MartinMinkov Aug 17, 2023
4c962fd
feat(mina-consensus.ts): add compareWithCondition function to compare…
MartinMinkov Aug 18, 2023
17b7d6e
feat(blockchain/types.ts, blockchain/utils.ts, db/sql/events-actions/…
MartinMinkov Aug 18, 2023
419b37c
feat(blockchain): add nextEpochLockCheckpoint to BlockInfo for better…
MartinMinkov Aug 20, 2023
35b5482
docs(mina-consensus.ts): update comments for chain selection function…
MartinMinkov Aug 20, 2023
83880c0
feat(consensus): remove unused long fork rules
MartinMinkov Aug 22, 2023
f3de73c
refactor(actions-service.ts, events-service.ts): move utility functio…
MartinMinkov Aug 30, 2023
63a6938
refactor(tracing-service.ts): make spanStack and traceInfo readonly a…
MartinMinkov Aug 30, 2023
e9ccb94
refactor(tracing): move Jaeger tracing setup to separate module for b…
MartinMinkov Aug 30, 2023
42c094a
feat(index.ts): wrap main function in try-catch block to handle poten…
MartinMinkov Aug 30, 2023
e80e530
docs(mina-consensus.ts): update comments for select function to impro…
MartinMinkov Aug 30, 2023
1f0d0a0
feat(scripts): remove download_network_config.sh script as it is no l…
MartinMinkov Aug 30, 2023
3fb6201
feat(package.json): update all dependencies to their latest versions …
MartinMinkov Aug 30, 2023
b0245cd
refactor(jaeger-tracing.ts): rename tracer from 'archive-node-graphql…
MartinMinkov Aug 30, 2023
27ff391
refactor(resolvers.ts): rename span names for better traceability
MartinMinkov Aug 30, 2023
7923b9d
chore(package-lock.json): remove unused 'ws' package from node_module…
MartinMinkov Aug 30, 2023
1b3465c
fix(package-lock.json): fix deps
MartinMinkov Aug 30, 2023
b4468fd
refactor(utils.test.ts): update import path for utility functions to …
MartinMinkov Aug 30, 2023
8b92046
refactor(context.ts): remove getCurrentSpanFromGraphQLContext functio…
MartinMinkov Aug 31, 2023
9d0e809
refactor(plugins.ts): disable eslint rule for explicit any to allow a…
MartinMinkov Aug 31, 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
13 changes: 13 additions & 0 deletions .env2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PORT=8080
LOG_LEVEL="info"
CORS_ORIGIN="*"

PG_CONN="postgres://postgres:password@localhost:5432/archive"

ENABLE_GRAPHIQL="true"
ENABLE_INTROSPECTION="true"

ENABLE_LOGGING="true"
ENABLE_JAEGER="true"
JAEGER_SERVICE_NAME="archive-api"
JAEGER_ENDPOINT='http://localhost:14268/api/traces'
23 changes: 15 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Stage 1: Build the TypeScript code
FROM node:14 as build
FROM node:18-alpine as build
WORKDIR /app
COPY package*.json ./
RUN npm i -g typescript
RUN npm ci
COPY . .
COPY src ./src
COPY tsconfig.json ./
RUN npm run build

# Stage 2: Copy the built code and install the production dependencies
FROM node:14
# Stage 2: Copy the built code and the node modules
FROM node:18-alpine
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/build ./build
COPY package*.json ./
COPY schema.graphql ./
RUN npm ci --only=production
COPY --from=build /app/build /app/build

# Don't run as root
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nodeuser -u 1001
RUN chown -R nodeuser:nodejs /app
USER nodeuser

EXPOSE 8080
CMD [ "npm", "start" ]
CMD ["npm", "start"]
79 changes: 79 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
version: '3.3'

services:
archive:
image: ${ARCHIVE}
container_name: archive
depends_on:
- postgres
pid: host
restart: always
env_file:
- ./.env
command: mina-archive run --postgres-uri ${PGURI} --server-port 3086 --log-level debug
networks:
- archive
- mina

postgres:
image: ${POSTGRES}
container_name: postgres
ports:
- '5432:5432'
env_file:
- ./.env
environment:
POSTGRES_USER: ${PGUSER}
POSTGRES_PASSWORD: ${PGPASSWORD}
POSTGRES_DB: ${PGDATABASE}
PGDATA: ${PGDATA}
volumes:
- './data/${PG_DUMP}:/data/${PG_DUMP}'
- './scripts/init_docker_compose.sh:/docker-entrypoint-initdb.d/init.sh'
- './db:/var/lib/postgresql/data'
command: postgres -N 1000
networks:
- archive

jaeger:
image: ${JAEGER}
container_name: jaeger
env_file:
- ./.env
restart: always
ports:
- '5775:5775/udp'
- '6831:6831/udp'
- '6832:6832/udp'
- '5778:5778'
- '9411:9411'
- '${JAEGER_FRONTEND}:16686'
- '${JAEGER_LOG_PORT}:14268'
networks:
- archive

app:
build: .
container_name: app
depends_on:
- postgres
env_file:
- ./.env
restart: always
ports:
- '8080:8080'
command: npm run dev
volumes:
- .:/app
- /app/node_modules
networks:
- archive

volumes:
db:

networks:
archive:
driver: bridge
mina:
driver: bridge
Loading
Loading