diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000000..1de1b6372c --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,28 @@ +name: Changelog + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-changelog: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@main + with: + fetch-depth: 0 + + - name: Check if CHANGELOG.md is modified + run: | + # Get the list of changed files in the PR + changed_files=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.sha }}) + + # Check if CHANGELOG.md is in the list of changed files + if echo "$changed_files" | grep -q '^CHANGELOG.md$'; then + echo "CHANGELOG.md has been modified." + else + echo $'::warning file=CHANGELOG.md::CHANGELOG.md has not been modified.\n This warning can be ignored if is has been explicitely decided not to log changes.\n Except in this situation, make sure to add log changes.' + exit 1 + fi diff --git a/processor/src/debug.rs b/processor/src/debug.rs index d8c274079f..5ae7441d00 100644 --- a/processor/src/debug.rs +++ b/processor/src/debug.rs @@ -63,7 +63,7 @@ pub struct VmStateIterator { } impl VmStateIterator { - pub(super) fn new(process: Process, result: Result) -> Self + pub fn new(process: Process, result: Result) -> Self where H: Host, { diff --git a/processor/src/lib.rs b/processor/src/lib.rs index fc6b136a2b..a254a1b1a6 100644 --- a/processor/src/lib.rs +++ b/processor/src/lib.rs @@ -162,8 +162,17 @@ where // PROCESS // ================================================================================================ +/// A [Process] is the underlying execution engine for a Miden [Program]. +/// +/// Typically, you do not need to worry about, or use [Process] directly, instead you should prefer +/// to use either [execute] or [execute_iter], which also handle setting up the process state, +/// inputs, as well as compute the [ExecutionTrace] for the program. +/// +/// However, for situations in which you want finer-grained control over those steps, you will need +/// to construct an instance of [Process] using [Process::new], invoke [Process::execute], and then +/// get the execution trace using [ExecutionTrace::new] using the outputs produced by execution. #[cfg(not(any(test, feature = "internals")))] -struct Process +pub struct Process where H: Host, { @@ -177,6 +186,21 @@ where enable_tracing: bool, } +#[cfg(any(test, feature = "internals"))] +pub struct Process +where + H: Host, +{ + pub system: System, + pub decoder: Decoder, + pub stack: Stack, + pub range: RangeChecker, + pub chiplets: Chiplets, + pub host: RefCell, + pub max_cycles: u32, + pub enable_tracing: bool, +} + impl Process where H: Host, @@ -645,21 +669,3 @@ impl ProcessState for Process { self.chiplets.get_mem_state_at(ctx, self.system.clk()) } } - -// INTERNALS -// ================================================================================================ - -#[cfg(any(test, feature = "internals"))] -pub struct Process -where - H: Host, -{ - pub system: System, - pub decoder: Decoder, - pub stack: Stack, - pub range: RangeChecker, - pub chiplets: Chiplets, - pub host: RefCell, - pub max_cycles: u32, - pub enable_tracing: bool, -} diff --git a/processor/src/trace/mod.rs b/processor/src/trace/mod.rs index 888d6064e1..15b1a06b4f 100644 --- a/processor/src/trace/mod.rs +++ b/processor/src/trace/mod.rs @@ -66,7 +66,7 @@ impl ExecutionTrace { // CONSTRUCTOR // -------------------------------------------------------------------------------------------- /// Builds an execution trace for the provided process. - pub(super) fn new(process: Process, stack_outputs: StackOutputs) -> Self + pub fn new(process: Process, stack_outputs: StackOutputs) -> Self where H: Host, {