Skip to content

Commit

Permalink
update tracing output (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci committed Apr 17, 2024
1 parent e876e63 commit ea723e8
Show file tree
Hide file tree
Showing 10 changed files with 650 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
run: npx playwright install --with-deps
- name: Run Playwright tests
run: yarn workspace web-test run test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
Expand Down
2 changes: 1 addition & 1 deletion executor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@acala-network/chopsticks-executor",
"description": "Chopsticks executor",
"version": "0.10.0",
"version": "0.10.1",
"license": "Apache-2.0",
"type": "module",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/chopsticks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks",
"version": "0.10.0",
"version": "0.10.1",
"author": "Acala Developers <hello@acala.network>",
"license": "Apache-2.0",
"bin": "./chopsticks.cjs",
Expand Down

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions packages/chopsticks/src/plugins/trace-transaction/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,33 @@ export type CallTrace = {
error: string | null
revertReason: string | null
depth: number
logs: LogTrace[]
calls: CallTrace[]
}

export type LogTrace =
| {
log: {
address: HexString
topics: HexString[]
data: HexString
}
}
| {
sLoad: {
address: HexString
index: HexString
value: HexString
}
}
| {
sStore: {
address: HexString
index: HexString
value: HexString
}
}

export type Step = {
op: number
pc: number
Expand Down Expand Up @@ -53,6 +77,28 @@ export const registerTypes = (registry: Registry) => {
SUICIDE: null,
},
},
Log: {
address: 'H160',
topics: 'Vec<H256>',
data: 'Bytes',
},
SLoad: {
address: 'H160',
index: 'H256',
value: 'H256',
},
SStore: {
address: 'H160',
index: 'H256',
value: 'H256',
},
LogTrace: {
_enum: {
Log: 'Log',
SLoad: 'SLoad',
SStore: 'SStore',
},
},
CallTrace: {
type: 'CallType',
from: 'H160',
Expand All @@ -65,6 +111,7 @@ export const registerTypes = (registry: Registry) => {
error: 'Option<String>',
revertReason: 'Option<String>',
depth: 'Compact<u32>',
logs: 'Vec<LogTrace>',
calls: 'Vec<CallTrace>',
},
TraceOutcome: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-core",
"version": "0.10.0",
"version": "0.10.1",
"author": "Acala Developers <hello@acala.network>",
"license": "Apache-2.0",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ export class SetValidationData implements InherentProvider {
extrinsic.relayChainState.trieNodes,
)

const slotIncrease = (meta.consts.timestamp.minimumPeriod as any as BN)
.divn(3000) // relaychain min period
.toNumber()
const slotIncrease = Math.max(
1,
(meta.consts.timestamp.minimumPeriod as any as BN)
.divn(3000) // relaychain min period
.toNumber(),
)

for (const key of Object.values(WELL_KNOWN_KEYS)) {
if (key === WELL_KNOWN_KEYS.CURRENT_SLOT) {
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-db",
"version": "0.10.0",
"version": "0.10.1",
"author": "Acala Developers <hello@acala.network>",
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-testing",
"version": "0.10.0",
"version": "0.10.1",
"author": "Acala Developers <hello@acala.network>",
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-utils",
"version": "0.10.0",
"version": "0.10.1",
"author": "Acala Developers <hello@acala.network>",
"license": "Apache-2.0",
"type": "module",
Expand Down

0 comments on commit ea723e8

Please sign in to comment.