Skip to content

Commit 6f39aac

Browse files
caposselesasha-computerclaude
authored
Default offer params (#34)
* add note on defaults * simplify * use warning * add note * Style fixes: remove intensifiers and tighten phrasing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: sasha <33594434+sasha-computer@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cb8d162 commit 6f39aac

File tree

6 files changed

+16
-48
lines changed

6 files changed

+16
-48
lines changed

developers/tooling/sdk.mdx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,7 @@ async fn proof_submission(signer: &PrivateKeySigner, rpc_url: Url) -> anyhow::Re
119119
// Build the request.
120120
let request = client.new_request()
121121
.with_program(std::fs::read("guest.bin")?)
122-
.with_stdin(42u32.to_le_bytes())
123-
.with_offer(OfferParams::builder()
124-
.ramp_up_period(30)
125-
.lock_timeout(150)
126-
.timeout(300)
127-
);
122+
.with_stdin(42u32.to_le_bytes());
128123

129124
// Submit the request.
130125
let (request_id, expires_at) = client.submit(request).await?;

developers/tutorials/callbacks.mdx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ let request = client.new_request()
4646
RequirementParams::builder()
4747
.callback_address(counter_address)
4848
.callback_gas_limit(100_000)
49-
)
50-
.with_offer(
51-
OfferParams::builder()
52-
.min_price(parse_ether("0.001")?)
53-
.max_price(parse_ether("0.002")?)
54-
.timeout(1000)
55-
.lock_timeout(1000)
56-
.ramp_up_period(100)
5749
);
5850

5951
// Submit the request

developers/tutorials/proof-types.mdx

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,7 @@ Boundless supports requesting a raw Groth16 proof instead of a merkle inclusion
3232
let request = client.new_request()
3333
.with_program(program)
3434
.with_stdin(input)
35-
.with_groth16_proof() // Request raw Groth16 proof
36-
.with_offer(
37-
OfferParams::builder()
38-
.min_price(parse_ether("0.001")?)
39-
.max_price(parse_ether("0.002")?)
40-
.timeout(1000)
41-
.lock_timeout(1000)
42-
);
35+
.with_groth16_proof(); // Request raw Groth16 proof
4336
```
4437

4538
### Request a Blake3 Groth16 Proof
@@ -58,14 +51,7 @@ let request = client
5851
.new_request()
5952
.with_program(program)
6053
.with_stdin(input)
61-
.with_blake3_groth16_proof() // Request Blake3 Groth16 proof
62-
.with_offer(
63-
OfferParams::builder()
64-
.min_price(parse_ether("0.001")?)
65-
.max_price(parse_ether("0.002")?)
66-
.timeout(1000)
67-
.lock_timeout(1000)
68-
);
54+
.with_blake3_groth16_proof(); // Request Blake3 Groth16 proof
6955
```
7056

7157
## Considerations
@@ -110,14 +96,7 @@ In the composition example, we first request a raw Groth16 proof from the Boundl
11096
let request = client.new_request()
11197
.with_program(program)
11298
.with_stdin(input)
113-
.with_groth16_proof() // Request raw Groth16 proof
114-
.with_offer(
115-
OfferParams::builder()
116-
.min_price(parse_ether("0.001")?)
117-
.max_price(parse_ether("0.002")?)
118-
.timeout(1000)
119-
.lock_timeout(1000)
120-
);
99+
.with_groth16_proof(); // Request raw Groth16 proof
121100
```
122101

123102
We then provide the Groth16 proof as input to the `IDENTITY` zkVM guest program, and verify the proof.

developers/tutorials/request.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ The [Offer](/developers/tutorials/auction) specifies how much the requestor will
321321

322322
The Client helps you build requests and set these parameters. Within the client, the [OfferLayer](https://docs.rs/boundless-market/latest/boundless_market/request_builder/offer_layer/struct.OfferLayer.html) creates the offer. It contains a set of defaults, and logic to assign a price to your request.
323323

324+
<Warning>
325+
By default, the parameters maximize the chance of request fulfillment.
326+
They use relaxed timeouts, dynamic market pricing, and recommended collateral.
327+
Change them only when necessary.
328+
</Warning>
329+
324330
There are two ways to configure auction parameters:
325331

326332
1. Using `client_builder.config_offer_layer` to configure the offer building logic.
@@ -390,6 +396,10 @@ let client = Client::builder()
390396

391397
With this configuration, the SDK will execute the request to estimate cycles and calculate appropriate prices.
392398

399+
<Note>
400+
The SDK warns when an overridden parameter may reduce fulfillment chances.
401+
</Note>
402+
393403
### Funding Modes
394404

395405
<Warning>

developers/tutorials/smart-contract-requestor.mdx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,7 @@ Then we create our proof request, setting a `Requirement` that the journal shoul
101101
// Create the request params
102102
let request = client.new_request()
103103
.with_program_url(program_url)?
104-
.with_stdin(input)
105-
.with_offer(
106-
OfferParams::builder()
107-
.min_price(parse_ether("0.001")?)
108-
.max_price(parse_ether("0.002")?)
109-
.lock_timeout(1000)
110-
.timeout(2000)
111-
);
104+
.with_stdin(input);
112105

113106
// Build the request
114107
let request = client.build_request(request).await?;

developers/tutorials/tracking.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Here's how to wait for a request to be fulfilled:
2626
// Submit your request
2727
let request = client.new_request()
2828
.with_program(program)
29-
.with_stdin(input)
30-
.with_offer(offer_params);
29+
.with_stdin(input);
3130

3231
let (request_id, expires_at) = client.submit(request).await?;
3332

0 commit comments

Comments
 (0)