diff --git a/.github/build-postprocessors/Dockerfile b/.github/build-postprocessors/Dockerfile index 0e08c89..a2585c3 100644 --- a/.github/build-postprocessors/Dockerfile +++ b/.github/build-postprocessors/Dockerfile @@ -1,17 +1,13 @@ FROM golang:1.22 AS build - COPY post-processor /post-processor - RUN apt update RUN apt install -y --no-install-recommends git python3 python3-pip curl make RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y ENV PATH="${PATH}:/root/.cargo/bin" - WORKDIR / RUN make -C post-processor FROM ubuntu:latest COPY --from=build /post-processor/artifacts /artifacts - diff --git a/.github/workflows/post-processor.yaml b/.github/workflows/post-processor.yaml index a4fa37c..26c3a6f 100644 --- a/.github/workflows/post-processor.yaml +++ b/.github/workflows/post-processor.yaml @@ -39,7 +39,6 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: visiblev8/vv8-postprocessors:latest - - name: Remove artifacts if: always() uses: docker://ubuntu:latest diff --git a/post-processor/flow/main.go b/post-processor/flow/main.go index b3d2033..6a7d345 100644 --- a/post-processor/flow/main.go +++ b/post-processor/flow/main.go @@ -82,10 +82,10 @@ func (agg *flowAggregator) IngestRecord(ctx *core.ExecutionContext, lineNumber i agg.scriptList[ctx.Script.ID] = script } - currentAction := fmt.Sprint(offset) + string(',') + fullName + string(',') + string(op) + currentAction := fmt.Sprint(offset) + string(',') + fullName - if agg.lastAction[:len(agg.lastAction) - 2] == currentAction[:len(currentAction) - 2] && op == 'c' { - script.APIs = script.APIs[:len(script.APIs) - 1] + if agg.lastAction == currentAction && op == 'c' { + return nil } script.APIs = append(script.APIs, currentAction) @@ -96,8 +96,6 @@ func (agg *flowAggregator) IngestRecord(ctx *core.ExecutionContext, lineNumber i var scriptFlowFields = [...]string{ "isolate", - "submissionid", - "instanceid", "visiblev8", "code", "url", @@ -113,7 +111,7 @@ func (agg *flowAggregator) DumpToPostgresql(ctx *core.AggregationContext, sqlDb return err } - stmt, err := txn.Prepare(pq.CopyIn("linked_flow", scriptFlowFields[:]...)) + stmt, err := txn.Prepare(pq.CopyIn("script_flow", scriptFlowFields[:]...)) if err != nil { txn.Rollback() return err @@ -132,8 +130,6 @@ func (agg *flowAggregator) DumpToPostgresql(ctx *core.AggregationContext, sqlDb _, err = stmt.Exec( script.info.Isolate.ID, script.info.VisibleV8, - ctx.Ln.SubmissionID, - script.info.CodeHash, script.info.Code, script.info.URL, evaledById, diff --git a/post-processor/postgres_schema.sql b/post-processor/postgres_schema.sql index cd7e92b..56e27c5 100644 --- a/post-processor/postgres_schema.sql +++ b/post-processor/postgres_schema.sql @@ -172,20 +172,6 @@ CREATE TABLE IF NOT EXISTS script_flow ( evaled_by INT -- REFERENCES script_flow (id) ); -CREATE TABLE IF NOT EXISTS linked_flow ( - id SERIAL PRIMARY KEY NOT NULL, - isolate TEXT NOT NULL, -- V8 isolate pointer - submissionid TEXT, - scriptSHA2 BYTEA, - visiblev8 BOOLEAN NOT NULL, -- Is the script loaded by the browser/injected by VisibleV8 (in most cases you want to ignore scripts if this is true) - - code TEXT NOT NULL, - first_origin TEXT, - url TEXT, - apis TEXT[] NOT NULL, -- All APIs loaded by a script in the order they were executed - evaled_by INT -- REFERENCES script_flow (id) -); - -- Feature usage information (for monomorphic callsites) CREATE TABLE IF NOT EXISTS feature_usage ( id SERIAL PRIMARY KEY NOT NULL,