Skip to content

feat: support local fee payer sponsorship while preserving gas station defaults#17

Open
WGB5445 wants to merge 5 commits intomainfrom
logan/issue-13-local-fee-payer-sponsorship
Open

feat: support local fee payer sponsorship while preserving gas station defaults#17
WGB5445 wants to merge 5 commits intomainfrom
logan/issue-13-local-fee-payer-sponsorship

Conversation

@WGB5445
Copy link
Copy Markdown
Collaborator

@WGB5445 WGB5445 commented Apr 21, 2026

Summary

  • add optional fee_payer_account to BaseSDKOptions and BaseSDKOptionsSync
  • keep existing gas station behavior unchanged unless fee_payer_account is explicitly provided
  • add local fee payer submission flow (async/sync) that builds a fee-payer authenticator and submits signed BCS transactions to fullnode
  • add README documentation for sponsorship modes and local fee payer usage
  • add a comprehensive sponsorship regression test suite for async and sync paths

Motivation

Issue #13 requests gas sponsorship flexibility with custom account support while preserving current gas station usage and configuration.

Validation

  • uv run pytest
  • uv run ruff check src tests
  • uv run pyright

Fixes #13

Copilot AI review requested due to automatic review settings April 21, 2026 06:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “local fee payer” sponsorship mode to the Decibel SDK while preserving existing gas-station defaults, enabling transactions to be fee-sponsored by a locally provided Aptos account.

Changes:

  • Add optional fee_payer_account to BaseSDKOptions / BaseSDKOptionsSync and route fee-paid submission accordingly.
  • Implement async/sync local fee payer submission that builds a fee-payer authenticator and submits signed BCS transactions to the fullnode.
  • Add documentation and a sponsorship regression test suite for async and sync paths.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/decibel/_base.py Threads fee_payer_account through SDK options and submission flow; adds fee payer address override helper.
src/decibel/_fee_pay.py Adds local fee payer submission implementation and routing logic in async/sync submitters.
tests/test_sponsorship.py Adds coverage for routing, conflicting options, fee payer override behavior, and local fullnode submission.
README.md Documents sponsorship modes and how to configure a local fee payer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/decibel/_base.py
Comment thread src/decibel/_fee_pay.py Outdated
Comment thread src/decibel/_base.py
Comment thread src/decibel/_fee_pay.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for “local fee payer” gas sponsorship (fee payer signs locally and the SDK submits signed BCS directly to the fullnode) while keeping the existing gas station defaults unchanged unless explicitly overridden via options.

Changes:

  • Add fee_payer_account to BaseSDKOptions / BaseSDKOptionsSync and plumb it through submit_tx (async/sync), including a fee payer address override.
  • Extend fee-paid submission to support a local fee payer flow (async/sync) that constructs a fee-payer authenticator and submits to fullnode_url/transactions.
  • Add README documentation and a new sponsorship regression test suite.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/decibel/_base.py Adds fee_payer_account options, enforces option compatibility, overrides fee_payer_address, and forwards local fee payer settings into fee-pay submission.
src/decibel/_fee_pay.py Adds local fee payer submission path and BCS signed-transaction building for fee payer auth.
tests/test_sponsorship.py New tests covering option conflicts, routing behavior, fee payer address override, and local fullnode submission behavior (async/sync).
README.md Documents sponsorship modes and how to use fee_payer_account.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_sponsorship.py
Comment thread tests/test_sponsorship.py
Comment thread src/decibel/_fee_pay.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new sponsorship mode that allows submitting fee-payer sponsored transactions using a locally controlled Account, while keeping existing gas station defaults unchanged unless explicitly overridden.

Changes:

  • Add optional fee_payer_account to BaseSDKOptions / BaseSDKOptionsSync and wire it through async/sync submission paths.
  • Implement local fee payer submission in _fee_pay.py that builds a fee-payer authenticator and posts BCS signed transactions to the fullnode.
  • Add README documentation and a dedicated async/sync sponsorship regression test suite.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_sponsorship.py New regression tests covering routing and local fee payer submission behavior (async + sync).
src/decibel/_fee_pay.py Adds local-fee-payer submit path and routing logic when fee_payer_account is provided.
src/decibel/_base.py Plumbs fee_payer_account into BaseSDK and applies fee payer address overrides during send/submit.
README.md Documents sponsorship modes and how to use fee_payer_account.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/decibel/_base.py
Comment thread src/decibel/_base.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “local fee payer” sponsorship mode to the Decibel SDK so callers can sponsor gas with a provided Account while keeping the existing gas station behavior as the default.

Changes:

  • Add optional fee_payer_account to async/sync SDK options and route fee-paid submission through local signing when provided.
  • Implement async/sync local fee-payer submission that builds a fee-payer authenticator and submits BCS signed transactions directly to the fullnode.
  • Add README docs and a new sponsorship regression test suite covering routing and local submission behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/decibel/_base.py Adds fee_payer_account options + fee payer address override logic and passes local fee payer info into fee-paid submitters.
src/decibel/_fee_pay.py Adds local fee payer submission + signed transaction building utilities; updates routing based on fee_payer_account.
tests/test_sponsorship.py New comprehensive tests for routing, option conflicts, address override behavior, and local submission (async/sync).
README.md Documents sponsorship modes and how to enable local fee payer usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/decibel/_base.py Outdated
Comment thread src/decibel/_base.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in “local fee payer” sponsorship path while keeping the existing gas station sponsorship defaults unchanged, addressing Issue #13’s request for flexible sponsorship without breaking current behavior.

Changes:

  • Introduces optional fee_payer_account on BaseSDKOptions / BaseSDKOptionsSync, with validation against no_fee_payer.
  • Routes fee-paid submission through a new local fee payer flow (async/sync) when fee_payer_account is provided; otherwise preserves existing gas station routing.
  • Adds README documentation and a new async+sync sponsorship regression test suite.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/test_sponsorship.py New regression suite covering routing, validation, local submission, and async/sync parity.
src/decibel/_fee_pay.py Adds local fee payer submission (build fee payer authenticator, submit signed BCS to fullnode) and routing logic updates.
src/decibel/_base.py Adds options plumbing + fee payer address override/validation to keep defaults while enabling local fee payer mode.
README.md Documents sponsorship modes and how to enable local fee payer via BaseSDKOptions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@WGB5445 WGB5445 requested a review from gregnazario April 21, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance SDK Gas Sponsorship Flexibility with Custom Account Support

2 participants