Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Push Commits – Makechain
Skip to content

Push Commits

Bundle commit metadata, upload content to the DA layer, and update refs — all in a single atomic flow. Consensus orders the operations and the ref update uses compare-and-swap to prevent conflicts.

Demo

Push commits to a projectdemo
Upload content to DA layer
Files3 blobs, 2 trees
Total size14.2 KB
DA referencebafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
Submit COMMIT_BUNDLE
COMMIT_BUNDLE message
{
  "type": "COMMIT_BUNDLE",
  "mid": 42,
  "timestamp": 1740000100,
  "body": {
    "project_id": "a1b2c3d4e5f6...",
    "da_reference": "bafybeigdyrzt5sfp7u...",
    "commits": [
      {
        "hash": "c0ff33deadbeef...",
        "parent_hashes": [
          "aabbccdd1122..."
        ],
        "tree_root_hash": "11223344aabb...",
        "author_mid": 42,
        "title": "feat: add user authentication",
        "message_hash": "eeff00112233..."
      }
    ]
  }
}
Validated — AGENT scope
Update ref (compare-and-swap)
REF_UPDATE message
{
  "type": "REF_UPDATE",
  "mid": 42,
  "timestamp": 1740000100,
  "body": {
    "project_id": "a1b2c3d4e5f6...",
    "ref_name": "refs/heads/main",
    "new_hash": "c0ff33deadbeef...",
    "old_hash": "aabbccdd1122...",
    "force": false
  }
}
CAS matchedFast-forward verified
Block inclusion and finality
COMMIT_BUNDLE entered mempoolT+0ms
REF_UPDATE entered mempoolT+1ms
Both included in block #1,312T+205ms
Parallel execution — project group a1b2c3d4T+205ms
FinalizedT+296ms
refs/heads/mainc0ff33deadbeef01234567890abcdef0 c0ff33deadbeef01234567890abcdef0
Commits in project47 / 10,000
Project: my-first-repoRef: refs/heads/main

CLI equivalent

# Push content (bundles commits + updates ref in one operation)
makechain push --project a1b2c3d4... --ref refs/heads/main

What happened

  1. DA upload — File content (blobs and tree structures) is uploaded to the data availability layer. The consensus layer never sees the raw content — only a da_reference pointing to it.

  2. Commit bundle — A COMMIT_BUNDLE message declares the new commit metadata: hash, parent hashes, tree root, author, and title. Commits are ordered parent-first within the bundle. The required scope is AGENT, allowing CI/CD systems and automated tooling to push on behalf of users.

  3. Ref update — A REF_UPDATE message moves refs/heads/main to the new commit. It includes the expected current hash (old_hash) for compare-and-swap. If another push landed between your read and write, the CAS check fails and the update is rejected — no silent overwrites. The update must be fast-forward (new commit descends from old) unless force: true.

  4. Parallel execution — Both messages are grouped by project_id and executed together in the project's parallel execution group. The overlay store provides copy-on-write isolation from other projects in the same block.